-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
with capsys.disabled() causes "I/O operation on closed file" #1873
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
Comments
Thanks for the report. Did this worked in a previous version? Could please you post a reproducible example? |
|
Duh 😅 @brechtm I see you are constructing the sphinx = Sphinx(...)
with capsys.disabled();
sphinx.build() Try construct the with capsys.disabled();
sphinx = Sphinx(...)
sphinx.build() I suspect the error is happening because some code is opening and keeping a reference to a log file somewhere, and |
Nope, the problem persists if I make the instantiation part of the context. It does work, however, if I also move the import statement to the content:
Which might indicate some nasty trickery going on in the Sphinx modules, indeed :-) |
It is probably setting up a logger at module level, which is actually the usual approach to logging. I think we can close this as there is nothing that can be done on Pytest's side. Feel free to reopen if you still want to discuss something or have other questions. 😁 |
Sphinx.build() fails if contained in a
capsys.disabled()
context manager:Full log: https://travis-ci.org/brechtm/rinohtype/jobs/155119487
Running the tests with the
-s
flag instead of the context manager works fine.The text was updated successfully, but these errors were encountered: