File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -1027,24 +1027,28 @@ def test_trace_after_runpytest(testdir):
10271027 from _pytest.debugging import pytestPDB
10281028
10291029 def test_outer(testdir):
1030- from _pytest.debugging import pytestPDB
1031-
10321030 assert len(pytestPDB._saved) == 1
10331031
1034- testdir.runpytest("-k test_inner")
1032+ testdir.makepyfile(
1033+ \" ""
1034+ from _pytest.debugging import pytestPDB
10351035
1036- __import__('pdb').set_trace()
1036+ def test_inner():
1037+ assert len(pytestPDB._saved) == 2
1038+ print()
1039+ print("test_inner_" + "end")
1040+ \" ""
1041+ )
1042+
1043+ result = testdir.runpytest("-s", "-k", "test_inner")
1044+ assert result.ret == 0
10371045
1038- def test_inner(testdir):
1039- assert len(pytestPDB._saved) == 2
1046+ assert len(pytestPDB._saved) == 1
10401047 """
10411048 )
1042- child = testdir .spawn_pytest ("-p pytester %s -k test_outer" % p1 )
1043- child .expect (r"\(Pdb" )
1044- child .sendline ("c" )
1045- rest = child .read ().decode ("utf8" )
1046- TestPDB .flush (child )
1047- assert child .exitstatus == 0 , rest
1049+ result = testdir .runpytest_subprocess ("-s" , "-p" , "pytester" , str (p1 ))
1050+ result .stdout .fnmatch_lines (["test_inner_end" ])
1051+ assert result .ret == 0
10481052
10491053
10501054def test_quit_with_swallowed_SystemExit (testdir ):
You can’t perform that action at this time.
0 commit comments