Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File tests explode when run with --looponfail #410

Closed
alex opened this issue Feb 19, 2013 · 3 comments
Closed

File tests explode when run with --looponfail #410

alex opened this issue Feb 19, 2013 · 3 comments
Labels

Comments

@alex
Copy link
Member

alex commented Feb 19, 2013

The traceback looks like

tests/objects/test_fileobject.py ..................
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR>     doit(config, session)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/main.py", line 113, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 422, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/main.py", line 133, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 422, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/runner.py", line 62, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/runner.py", line 69, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/runner.py", line 100, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/main.py", line 157, in call_matching_hooks
INTERNALERROR>     return hookmethod.pcall(plugins, **kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 426, in pcall
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/capture.py", line 172, in pytest_runtest_makereport
INTERNALERROR>     outerr = self.suspendcapture(item)
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/_pytest/capture.py", line 111, in suspendcapture
INTERNALERROR>     outerr = cap.suspend()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/py/_io/capture.py", line 174, in suspend
INTERNALERROR>     outfile, errfile = self.done()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/py/_io/capture.py", line 247, in done
INTERNALERROR>     tmpfile = self.in_.done()
INTERNALERROR>   File "/Users/alex_gaynor/.virtualenvs/topaz/lib/python2.7/site-packages/py/_io/capture.py", line 73, in done
INTERNALERROR>     os.close(self._savefd)
INTERNALERROR> OSError: [Errno 9] Bad file descriptor

/cc @timfel I'm thinking this is related to the popen tests

@alex
Copy link
Member Author

alex commented Feb 19, 2013

The explosion occurs during:

tests/objects/test_fileobject.py:238: TestIO.test_reopen_stderr_in_stdout

@alex
Copy link
Member Author

alex commented Feb 19, 2013

The problem is that this is closing the file descriptor on stdout. This test should either use a different fileobject (this seems prerably) or also mock close. I don't think we need a test specifically about stdout/stderr though anyways, do we?

@timfel
Copy link
Member

timfel commented Feb 19, 2013

You're right, you can remove that test. We test reopen with file objects further below.

@alex alex closed this as completed in a63b0eb Feb 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants