diff options
| author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-03-15 09:36:04 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 09:36:04 (GMT) |
| commit | a50cf6c3d76b34e2ee9f92a248f1b0df24e407f6 (patch) | |
| tree | 5d7a7957df72fad5521457a1086e28214b65d267 /Lib/test | |
| parent | 8fc8fbb43a8bb46c04ab55f96049039de243afb0 (diff) | |
| download | cpython-a50cf6c3d76b34e2ee9f92a248f1b0df24e407f6.zip cpython-a50cf6c3d76b34e2ee9f92a248f1b0df24e407f6.tar.gz cpython-a50cf6c3d76b34e2ee9f92a248f1b0df24e407f6.tar.bz2 | |
gh-90095: Ignore empty lines and comments in `.pdbrc` (#116834)
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_pdb.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 4472854..69691e9 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -2933,8 +2933,27 @@ def bœr(): """) stdout, stderr = self.run_pdb_script(script, 'q\n', pdbrc=pdbrc, remove_home=True) + self.assertNotIn("SyntaxError", stdout) self.assertIn("a+8=9", stdout) + def test_pdbrc_empty_line(self): + """Test that empty lines in .pdbrc are ignored.""" + + script = textwrap.dedent(""" + a = 1 + b = 2 + c = 3 + """) + + pdbrc = textwrap.dedent(""" + n + + """) + + stdout, stderr = self.run_pdb_script(script, 'q\n', pdbrc=pdbrc, remove_home=True) + self.assertIn("b = 2", stdout) + self.assertNotIn("c = 3", stdout) + def test_pdbrc_alias(self): script = textwrap.dedent(""" class A: |
