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

Method test_issue84583

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

Source from the content-addressed store, hash-verified

3915 .format(expected, stderr))
3916
3917 def test_issue84583(self):
3918 # A syntax error from ast.literal_eval should not make pdb exit.
3919 script = "import ast; ast.literal_eval('')\n"
3920 commands = """
3921 continue
3922 where
3923 quit
3924 """
3925 stdout, stderr = self.run_pdb_script(script, commands)
3926 # The code should appear 3 times in the stdout/stderr:
3927 # 1. when pdb starts (stdout)
3928 # 2. when the exception is raised, in trackback (stderr)
3929 # 3. in where command (stdout)
3930 self.assertEqual(stdout.count("ast.literal_eval('')"), 2)
3931 self.assertEqual(stderr.count("ast.literal_eval('')"), 1)
3932
3933 def test_issue26053(self):
3934 # run command of pdb prompt echoes the correct args

Callers

nothing calls this directly

Calls 3

run_pdb_scriptMethod · 0.95
assertEqualMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected