From f6d43c5bd6635efd86b10a45b3a383ff25ba6032 Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Mon, 3 May 2021 14:38:23 -0400 Subject: [PATCH] Fix file closing unit test breaking due to pytest --- tests/tools/test_logging.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/tools/test_logging.py b/tests/tools/test_logging.py index d2e5ae17..951046b7 100644 --- a/tests/tools/test_logging.py +++ b/tests/tools/test_logging.py @@ -71,6 +71,9 @@ def test_command_close_stdout(tmpdir): with args.other as _: pass - assert not args.input.closed + # pytest patches sys.input on some platforms it seems + if hasattr(args.input, "closed"): + assert not args.input.closed + assert not args.output.closed assert args.other.closed