From 35eec99d41777282785666b4190c97518c9bf458 Mon Sep 17 00:00:00 2001 From: David Szotten Date: Mon, 22 Sep 2014 13:56:07 +0100 Subject: [PATCH] stop leaking file descriptors tripps --lsof on os x but not on linux. there's possibly a bug in the leak detector (not investigated here) --HG-- branch : stop_leaking_fds --- testing/test_capture.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing/test_capture.py b/testing/test_capture.py index 167f2e635..bf44f90d5 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -744,6 +744,7 @@ class TestFDCapture: cap.done() pytest.raises(AttributeError, cap.suspend) + @contextlib.contextmanager def saved_fd(fd): new_fd = os.dup(fd) @@ -751,6 +752,7 @@ def saved_fd(fd): yield finally: os.dup2(new_fd, fd) + os.close(new_fd) class TestStdCapture: