noticed in #203
When unit tests fail, there is an issue where log file is closed prior to test exiting.
Example error:
Message: 'p4 sync --parallel=threads=0 //...'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "/Users/carl/.pyenv/versions/3.6.0/lib/python3.6/logging/__init__.py", line 989, in emit
stream.write(msg)
ValueError: I/O operation on closed file.
Repro caused by removing one of the with exception blocks in a unit test (or adding one where an exception is not raised)
I was able to track this down to the use of capsys in test_server_fixture
If we remove such usage, the issue is resolved. However, it is quite convenient to print to stdout the server address.
Suggested solutions:
- Find a workaround to allow continued use of
capsys
- Remove use of
capsys, add to instructions in test_server_fixture to run pytest with a special flag to disable output capturing so you can still see the test server address printed to stdout
noticed in #203
When unit tests fail, there is an issue where log file is closed prior to test exiting.
Example error:
Repro caused by removing one of the
with exceptionblocks in a unit test (or adding one where an exception is not raised)I was able to track this down to the use of
capsysintest_server_fixtureIf we remove such usage, the issue is resolved. However, it is quite convenient to print to stdout the server address.
Suggested solutions:
capsyscapsys, add to instructions intest_server_fixtureto run pytest with a special flag to disable output capturing so you can still see the test server address printed to stdout