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 @@ -1024,24 +1024,28 @@ def test_trace_after_runpytest(testdir):
10241024 from _pytest.debugging import pytestPDB
10251025
10261026 def test_outer(testdir):
1027- from _pytest.debugging import pytestPDB
1028-
10291027 assert len(pytestPDB._saved) == 1
10301028
1031- testdir.runpytest("-k test_inner")
1029+ testdir.makepyfile(
1030+ \" ""
1031+ from _pytest.debugging import pytestPDB
10321032
1033- __import__('pdb').set_trace()
1033+ def test_inner():
1034+ assert len(pytestPDB._saved) == 2
1035+ print()
1036+ print("test_inner_" + "end")
1037+ \" ""
1038+ )
1039+
1040+ result = testdir.runpytest("-s", "-k", "test_inner")
1041+ assert result.ret == 0
10341042
1035- def test_inner(testdir):
1036- assert len(pytestPDB._saved) == 2
1043+ assert len(pytestPDB._saved) == 1
10371044 """
10381045 )
1039- child = testdir .spawn_pytest ("-p pytester %s -k test_outer" % p1 )
1040- child .expect (r"\(Pdb" )
1041- child .sendline ("c" )
1042- rest = child .read ().decode ("utf8" )
1043- TestPDB .flush (child )
1044- assert child .exitstatus == 0 , rest
1046+ result = testdir .runpytest_subprocess ("-s" , "-p" , "pytester" , str (p1 ))
1047+ result .stdout .fnmatch_lines (["test_inner_end" ])
1048+ assert result .ret == 0
10451049
10461050
10471051def test_quit_with_swallowed_SystemExit (testdir ):
You can’t perform that action at this time.
0 commit comments