pytest>6.2.0
emits warnings for unraisable exceptions and unhandled thread exceptions under Python 3.8+
#355
Labels
bug
Something is broken
β I'm submitting a ...
π Describe the bug. What is the current behavior?
pytest 6.2.0 introduced
unraisableexception
andthreadexception
modules that are enabled by default. They exploitsys.unraisablehook
andthreading.excepthook
that were introduced in Python 3.8.This makes pytest emit warnings for unclosed resources and unhandled exceptions that happen in threads when run under Python 3.8.
Our pytest.ini turns those exceptions into errors with
filterwarnings = error
which results in a failed test run outcome under the conditions described above.The short-term solution is to patch the
filterwarnings
setting but in the long-term we need to investigate how to prevent those permanently.β What is the motivation / use case for changing the behavior?
Green tests.
π‘ To Reproduce
Run
tox
under Python 3.8+ onmaster
.π‘ Expected behavior
No errors in CI.
π Details
https://docs.pytest.org/en/stable/usage.html#unraisable
π Environment
π Additional context
pytest-dev/pytest#5299
The text was updated successfully, but these errors were encountered: