Skip to content

Commit f6d43c5

Browse files
committed
Fix file closing unit test breaking due to pytest
1 parent 3954f59 commit f6d43c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/tools/test_logging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def test_command_close_stdout(tmpdir):
7171
with args.other as _:
7272
pass
7373

74-
assert not args.input.closed
74+
# pytest patches sys.input on some platforms it seems
75+
if hasattr(args.input, "closed"):
76+
assert not args.input.closed
77+
7578
assert not args.output.closed
7679
assert args.other.closed

0 commit comments

Comments
 (0)