File tree Expand file tree Collapse file tree 1 file changed +30
-25
lines changed
Expand file tree Collapse file tree 1 file changed +30
-25
lines changed Original file line number Diff line number Diff line change @@ -253,31 +253,36 @@ def setUp(self):
253253 # Create a file for subprocess script
254254 self .script_path = TESTFN + "_connect_test.py"
255255 with open (self .script_path , 'w' ) as f :
256- f .write (f"""
257- import pdb
258- import sys
259- import time
260-
261- def connect_to_debugger():
262- # Create a frame to debug
263- def dummy_function():
264- x = 42
265- # Call connect to establish connection with the test server
266- frame = sys._getframe() # Get the current frame
267- pdb._connect(
268- host='127.0.0.1',
269- port={ self .port } ,
270- frame=frame,
271- commands="",
272- version=pdb._PdbServer.protocol_version(),
273- )
274- return x # This line should not be reached in debugging
275-
276- return dummy_function()
277-
278- result = connect_to_debugger()
279- print(f"Function returned: {{result}}")
280- """ )
256+ f .write (
257+ textwrap .dedent (
258+ f"""
259+ import pdb
260+ import sys
261+ import time
262+
263+ def connect_to_debugger():
264+ # Create a frame to debug
265+ def dummy_function():
266+ x = 42
267+ # Call connect to establish connection
268+ # with the test server
269+ frame = sys._getframe() # Get the current frame
270+ pdb._connect(
271+ host='127.0.0.1',
272+ port={ self .port } ,
273+ frame=frame,
274+ commands="",
275+ version=pdb._PdbServer.protocol_version(),
276+ )
277+ return x # This line won't be reached in debugging
278+
279+ return dummy_function()
280+
281+ result = connect_to_debugger()
282+ print(f"Function returned: {{result}}")
283+ """
284+ )
285+ )
281286
282287 def tearDown (self ):
283288 self .server_sock .close ()
You can’t perform that action at this time.
0 commit comments