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

Method test_pdbrc_alias

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

Source from the content-addressed store, hash-verified

4024 self.assertNotIn("c = 3", stdout)
4025
4026 def test_pdbrc_alias(self):
4027 script = textwrap.dedent("""
4028 class A:
4029 def __init__(self):
4030 self.attr = 1
4031 a = A()
4032 b = 2
4033 """)
4034
4035 pdbrc = textwrap.dedent("""
4036 alias pi for k in %1.__dict__.keys(): print(f"%1.{k} = {%1.__dict__[k]}")
4037 until 6
4038 pi a
4039 """)
4040
4041 stdout, stderr = self.run_pdb_script(script, 'q\n', pdbrc=pdbrc, remove_home=True)
4042 self.assertIn("a.attr = 1", stdout)
4043
4044 def test_pdbrc_semicolon(self):
4045 script = textwrap.dedent("""

Callers

nothing calls this directly

Calls 3

run_pdb_scriptMethod · 0.95
assertInMethod · 0.80
dedentMethod · 0.45

Tested by

no test coverage detected