MCPcopy Index your code
hub / github.com/python/cpython / test_checkline_is_not_executable

Method test_checkline_is_not_executable

Lib/test/test_pdb.py:4776–4790  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4774 self.assertEqual(db.checkline(os_helper.TESTFN, 1), 1)
4775
4776 def test_checkline_is_not_executable(self):
4777 # Test for comments, docstrings and empty lines
4778 s = textwrap.dedent("""
4779 # Comment
4780 \"\"\" docstring \"\"\"
4781 ''' docstring '''
4782
4783 """)
4784 with open(os_helper.TESTFN, "w") as f:
4785 f.write(s)
4786 num_lines = len(s.splitlines()) + 2 # Test for EOF
4787 with redirect_stdout(StringIO()):
4788 db = pdb.Pdb()
4789 for lineno in range(num_lines):
4790 self.assertFalse(db.checkline(os_helper.TESTFN, lineno))
4791
4792
4793@support.requires_subprocess()

Callers

nothing calls this directly

Calls 8

checklineMethod · 0.95
redirect_stdoutClass · 0.90
StringIOClass · 0.90
assertFalseMethod · 0.80
openFunction · 0.50
dedentMethod · 0.45
writeMethod · 0.45
splitlinesMethod · 0.45

Tested by

no test coverage detected