diff --git a/py/_io/capture.py b/py/_io/capture.py index 093685e82..fe03dee9a 100644 --- a/py/_io/capture.py +++ b/py/_io/capture.py @@ -334,6 +334,8 @@ class DontReadFromInput: raise ValueError("redirected Stdin is pseudofile, has no fileno()") def isatty(self): return False + def close(self): + pass try: devnullpath = os.devnull diff --git a/testing/io_/test_capture.py b/testing/io_/test_capture.py index 7b03c4ae1..fa64208a0 100644 --- a/testing/io_/test_capture.py +++ b/testing/io_/test_capture.py @@ -66,6 +66,7 @@ def test_dontreadfrominput(): py.test.raises(IOError, f.readlines) py.test.raises(IOError, iter, f) py.test.raises(ValueError, f.fileno) + f.close() # just for completeness def pytest_funcarg__tmpfile(request): testdir = request.getfuncargvalue("testdir")