mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
disconnect logging during MockHub cleanup
pytest appears to close captured FDs prematurely, causing huge "I/O operation on closed file" tracebacks whenever tests stop early due to a failure. This should quiet the extra traceback, though it could potentially silence useful log messages during cleanup in rare cases
This commit is contained in:
@@ -53,6 +53,9 @@ def app(request):
|
|||||||
|
|
||||||
|
|
||||||
def fin():
|
def fin():
|
||||||
|
# disconnect logging during cleanup because pytest closes captured FDs prematurely
|
||||||
|
mocked_app.log.handlers = []
|
||||||
|
|
||||||
MockHub.clear_instance()
|
MockHub.clear_instance()
|
||||||
mocked_app.stop()
|
mocked_app.stop()
|
||||||
request.addfinalizer(fin)
|
request.addfinalizer(fin)
|
||||||
|
Reference in New Issue
Block a user