Skip to content

Commit 8b5f437

Browse files
committed
Fix check_all_tests_are_covered hook
1 parent 2ac88af commit 8b5f437

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ repos:
6464
- id: check-no-tests-are-ignored
6565
additional_dependencies: [pandas,pyyaml]
6666
entry: python scripts/check_all_tests_are_covered.py
67-
files: ^\.github/workflows/pytest\.yml$
67+
files: ^.github/workflows/tests.yml$
6868
language: python
6969
name: Check no tests are ignored
7070
pass_filenames: false

scripts/check_all_tests_are_covered.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ def from_yaml():
105105
_log.info("Number of test runs (❌=0, ✅=once)\n%s", df.replace(0, "❌").replace(1, "✅"))
106106

107107
if ignored_by_all:
108-
_log.warning("%i tests are completely ignored:\n%s", len(ignored_by_all), ignored_by_all)
108+
raise AssertionError(
109+
f"{len(ignored_by_all)} tests are completely ignored:\n{ignored_by_all}"
110+
)
109111
if run_multiple_times:
110-
raise Exception(
112+
raise AssertionError(
111113
f"{len(run_multiple_times)} tests are run multiple times with the same OS and floatX setting:\n{run_multiple_times}"
112114
)
113115
return

0 commit comments

Comments
 (0)