Skip to content

Commit

Permalink
Test another fixture/--capture configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ayjayt committed Oct 7, 2024
1 parent 740b951 commit eaa4036
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions testing/test_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,18 @@ def test_one(capteesys):
# as opposed to both being reported on stdout
result = pytester.runpytest(p, "--quiet", "--quiet", "-rN", "--capture=tee-sys")
assert result.ret == ExitCode.OK
result.stdout.fnmatch_lines(["sTdoUt"])
result.stderr.fnmatch_lines(["sTdeRr"])
result.stdout.fnmatch_lines(["sTdoUt"]) # tee'd out
result.stderr.fnmatch_lines(["sTdeRr"]) # tee'd out

result = pytester.runpytest(p, "--quiet", "--quiet", "-rA", "--capture=tee-sys")
assert result.ret == ExitCode.OK
result.stdout.fnmatch_lines(["sTdoUt", "sTdoUt", "sTdeRr"]) # tee'd out, the next two reported
result.stderr.fnmatch_lines(["sTdeRr"]) # tee'd out

# -rA and --capture=sys means we'll read them on stdout.
result = pytester.runpytest(p, "--quiet", "--quiet", "-rA", "--capture=sys")
assert result.ret == ExitCode.OK
result.stdout.fnmatch_lines(["*sTdoUt*", "*sTdeRr*"])
result.stdout.fnmatch_lines(["sTdoUt", "sTdeRr"]) # no tee, just reported
assert not result.stderr.lines

def test_capsyscapfd(self, pytester: Pytester) -> None:
Expand Down

0 comments on commit eaa4036

Please sign in to comment.