Added stdio checker

This commit is contained in:
Itamar Hindi 2023-12-06 18:49:47 -05:00
parent ea5f445d12
commit 1009e1f754
1 changed files with 5 additions and 0 deletions

View File

@ -1620,6 +1620,11 @@ def pytest_report_header(config, start_path):
assert "!This is stderr!" not in stdout assert "!This is stderr!" not in stdout
assert "!This is a warning log msg!" in stdout assert "!This is a warning log msg!" in stdout
stdout = pytester.runpytest("--show-capture=stdio", "--tb=short").stdout.str()
assert "!This is stdout!" in stdout
assert "!This is stderr!" in stdout
assert "!This is a warning log msg!" not in stdout
stdout = pytester.runpytest("--show-capture=no", "--tb=short").stdout.str() stdout = pytester.runpytest("--show-capture=no", "--tb=short").stdout.str()
assert "!This is stdout!" not in stdout assert "!This is stdout!" not in stdout
assert "!This is stderr!" not in stdout assert "!This is stderr!" not in stdout