I have found the following code, which was added in 2c7d005 by @hpk42, but apparently without a test:
|
# make sure logging does not raise exceptions at the end |
|
def silence_logging_at_shutdown(): |
|
if "logging" in sys.modules: |
|
sys.modules["logging"].raiseExceptions = False |
|
|
|
early_config.add_cleanup(silence_logging_at_shutdown) |
A later commit (0719602) indicates that this might be because logging itself tries to close some fd.
I think it is bad practice to change module attributes, especially if it might indicate that pytest is/was doing something wrong itself.
I have found the following code, which was added in 2c7d005 by @hpk42, but apparently without a test:
pytest/src/_pytest/capture.py
Lines 59 to 64 in b3eb5d1
A later commit (0719602) indicates that this might be because logging itself tries to close some fd.
I think it is bad practice to change module attributes, especially if it might indicate that pytest is/was doing something wrong itself.