bpo-36969: Make PDB args command display positional only arguments (G… · python/cpython@4585603
@@ -80,10 +80,14 @@ def test_pdb_basic_commands():
8080 >>> def test_function3(arg=None, *, kwonly=None):
8181 ... pass
828283+ >>> def test_function4(a, b, c, /):
84+ ... pass
85+8386 >>> def test_function():
8487 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
8588 ... ret = test_function_2('baz')
8689 ... test_function3(kwonly=True)
90+ ... test_function4(1, 2, 3)
8791 ... print(ret)
88928993 >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
@@ -104,10 +108,14 @@ def test_pdb_basic_commands():
104108 ... 'next', # step to test_function3()
105109 ... 'step', # stepping into test_function3()
106110 ... 'args', # display function args
111+ ... 'return', # return out of function
112+ ... 'next', # step to test_function4()
113+ ... 'step', # stepping to test_function4()
114+ ... 'args', # display function args
107115 ... 'continue',
108116 ... ]):
109117 ... test_function()
110- > <doctest test.test_pdb.test_pdb_basic_commands[2]>(3)test_function()
118+ > <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
111119 -> ret = test_function_2('baz')
112120 (Pdb) step
113121 --Call--
@@ -130,14 +138,14 @@ def test_pdb_basic_commands():
130138 [EOF]
131139 (Pdb) bt
132140 ...
133- <doctest test.test_pdb.test_pdb_basic_commands[3]>(21)<module>()
141+ <doctest test.test_pdb.test_pdb_basic_commands[4]>(25)<module>()
134142 -> test_function()
135- <doctest test.test_pdb.test_pdb_basic_commands[2]>(3)test_function()
143+ <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
136144 -> ret = test_function_2('baz')
137145 > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
138146 -> def test_function_2(foo, bar='default'):
139147 (Pdb) up
140- > <doctest test.test_pdb.test_pdb_basic_commands[2]>(3)test_function()
148+ > <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
141149 -> ret = test_function_2('baz')
142150 (Pdb) down
143151 > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
@@ -176,7 +184,7 @@ def test_pdb_basic_commands():
176184 (Pdb) retval
177185 'BAZ'
178186 (Pdb) next
179- > <doctest test.test_pdb.test_pdb_basic_commands[2]>(4)test_function()
187+ > <doctest test.test_pdb.test_pdb_basic_commands[3]>(4)test_function()
180188 -> test_function3(kwonly=True)
181189 (Pdb) step
182190 --Call--
@@ -185,6 +193,21 @@ def test_pdb_basic_commands():
185193 (Pdb) args
186194 arg = None
187195 kwonly = True
196+ (Pdb) return
197+ --Return--
198+ > <doctest test.test_pdb.test_pdb_basic_commands[1]>(2)test_function3()->None
199+ -> pass
200+ (Pdb) next
201+ > <doctest test.test_pdb.test_pdb_basic_commands[3]>(5)test_function()
202+ -> test_function4(1, 2, 3)
203+ (Pdb) step
204+ --Call--
205+ > <doctest test.test_pdb.test_pdb_basic_commands[2]>(1)test_function4()
206+ -> def test_function4(a, b, c, /):
207+ (Pdb) args
208+ a = 1
209+ b = 2
210+ c = 3
188211 (Pdb) continue
189212 BAZ
190213 """