Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(unit_test): prevent logging from raising exceptions after tests
pytest's capsys just closes the stdout when done with tests. there are issues tracking this problem, see pytest-dev/pytest#5577 . but we adds a handler which redirect the logging messages to stdout. so, once pytest finishes testing, exceptions are raised when writing logging messages, like ``` 22:37:20 File "/usr/local/lib/python3.10/logging/__init__.py", line 1101, in emit 22:37:20 stream.write(msg + self.terminator) 22:37:20 ValueError: I/O operation on closed file. ``` so, in this change, `logging.raiseExceptions` is disabled when pytest's session finishes. Fixes scylladb#6000 Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information