Skip to content

Commit 9ca5e9b

Browse files
authored
test: fail on unraisable exceptions (#359)
See https://docs.pytest.org/en/latest/how-to/failures.html#warning-about-unraisable-exceptions-and-unhandled-thread-exceptions unraisable exceptions and unhandled thread exceptions are normally considered bugs, but may go unnoticed because they don’t cause the program itself to crash. Pytest detects these conditions and issues a warning that is visible in the test run summary. This PR changes the warnings to errors instead. Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
1 parent 277ecfb commit 9ca5e9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,8 @@ testpaths = [
235235
env = [
236236
"PYTHONWARNINGS=always::DeprecationWarning",
237237
]
238+
filterwarnings = [
239+
# https://docs.pytest.org/en/latest/how-to/failures.html#warning-about-unraisable-exceptions-and-unhandled-thread-exceptions
240+
"error::pytest.PytestUnraisableExceptionWarning",
241+
"error::pytest.PytestUnhandledThreadExceptionWarning",
242+
]

0 commit comments

Comments
 (0)