Skip to content

Commit cc62984

Browse files
committed
Check that nothing gets printed on stderr or stdout
1 parent d016842 commit cc62984

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,11 @@ def prevent_leaking_rng():
6363
random.setstate(builtin_rng_state)
6464
if torch.cuda.is_available():
6565
torch.cuda.set_rng_state(cuda_rng_state)
66+
67+
68+
@pytest.fixture(autouse=True)
69+
def check_no_stdout_or_stderr(capsys):
70+
yield
71+
captured = capsys.readouterr()
72+
assert not captured.out, "stdout output detected"
73+
assert not captured.err, "stderr output detected"

0 commit comments

Comments
 (0)