@@ -165,7 +165,6 @@ def task_example():
165165 _flush (child )
166166
167167
168- @pytest .mark .xfail (os .environ .get ("CI" ) == "true" , reason = "#312" )
169168@pytest .mark .skipif (not IS_PEXPECT_INSTALLED , reason = "pexpect is not installed." )
170169@pytest .mark .skipif (sys .platform == "win32" , reason = "pexpect cannot spawn on Windows." )
171170def test_pdb_interaction_capturing_simple (tmp_path ): # pragma: no cover
@@ -184,7 +183,9 @@ def task_1():
184183 child .expect (r"task_1\(\)" )
185184 child .expect ("Pdb" )
186185 child .sendline ("n" )
187- child .expect ("i == 1" )
186+ # Python < 3.13 stops at the next statement already, while Python >= 3.13
187+ # first stops on the set_trace call itself and reaches this line after "n".
188+ child .expect (["i == 1" , "assert 0" ])
188189 child .expect ("Pdb" )
189190 child .sendline ("c" )
190191 rest = child .read ().decode ("utf-8" )
@@ -275,7 +276,6 @@ def task_2():
275276 _flush (child )
276277
277278
278- @pytest .mark .xfail (os .environ .get ("CI" ) == "true" , reason = "#312" )
279279@pytest .mark .skipif (not IS_PEXPECT_INSTALLED , reason = "pexpect is not installed." )
280280@pytest .mark .skipif (sys .platform == "win32" , reason = "pexpect cannot spawn on Windows." )
281281def test_pdb_interaction_capturing_twice (tmp_path ): # pragma: no cover
@@ -295,21 +295,13 @@ def task_1():
295295
296296 child = pexpect .spawn (f"pytask { tmp_path .as_posix ()} " )
297297 child .expect (["PDB" , "set_trace" , r"\(IO-capturing" , "turned" , r"off\)" ])
298- child .expect ("task_1" )
299- child .expect ("Pdb" )
300- child .sendline ("n" )
301- child .expect ("x = 3" )
302298 child .expect ("Pdb" )
303299 child .sendline ("c" )
304300 child .expect (["PDB" , "continue" , r"\(IO-capturing" , r"resumed\)" ])
305301 child .expect (["PDB" , "set_trace" , r"\(IO-capturing" , "turned" , r"off\)" ])
306302 child .expect ("Pdb" )
307- child .sendline ("n" )
308- child .expect ("x = 4" )
309- child .expect ("Pdb" )
310303 child .sendline ("c" )
311304 child .expect (["PDB" , "continue" , r"\(IO-capturing" , r"resumed\)" ])
312- child .expect ("task_1" )
313305 child .expect ("failed" )
314306 rest = _escape_ansi (child .read ().decode ("utf8" ))
315307 assert "Captured stdout during call" in rest
0 commit comments