Skip to content

Commit

Permalink
Merge pull request #12 from opensafely-core/evansd/fail-on-warnings
Browse files Browse the repository at this point in the history
Fail test run if any warnings present
  • Loading branch information
evansd authored Jan 19, 2024
2 parents 940cfb5 + 4857f3d commit 7674adb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fail the test run if we see any warnings
def pytest_terminal_summary(terminalreporter, exitstatus, config):
if terminalreporter.stats.get("warnings"): # pragma: no cover
print("\nWARNINGS DETECTED: Exiting with error")
if terminalreporter._session.exitstatus == 0:
terminalreporter._session.exitstatus = 13

0 comments on commit 7674adb

Please sign in to comment.