add close method to DontReadFromInput so multiprocessing can close it

--HG--
branch : trunk
This commit is contained in:
Ronny Pfannschmidt 2010-04-29 19:46:43 +02:00
parent 962d0fe2be
commit b3ce06bbf9
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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")