Skip to content

Commit 843dc55

Browse files
committed
fix ignored test
1 parent 5fb92fb commit 843dc55

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

.github/workflows/pytest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ jobs:
2121
--ignore=pymc3/tests/test_distributions_timeseries.py
2222
--ignore=pymc3/tests/test_examples.py
2323
--ignore=pymc3/tests/test_gp.py
24+
--ignore=pymc3/tests/test_mixture.py
2425
--ignore=pymc3/tests/test_parallel_sampling.py
2526
--ignore=pymc3/tests/test_posteriors.py
2627
--ignore=pymc3/tests/test_quadpotential.py
2728
--ignore=pymc3/tests/test_random.py
2829
--ignore=pymc3/tests/test_sampling.py
29-
--ignore=pymc3/tests/test_shape_handling
30+
--ignore=pymc3/tests/test_shape_handling.py
3031
--ignore=pymc3/tests/test_shared.py
3132
--ignore=pymc3/tests/test_smc.py
3233
--ignore=pymc3/tests/test_updates.py
@@ -44,6 +45,7 @@ jobs:
4445
- |
4546
pymc3/tests/test_examples.py
4647
pymc3/tests/test_gp.py
48+
pymc3/tests/test_mixture.py
4749
pymc3/tests/test_posteriors.py
4850
pymc3/tests/test_quadpotential.py
4951
- |

.pre-commit-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ repos:
3131
- repo: local
3232
hooks:
3333
- id: watermark
34-
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Wiki)
35-
types: [jupyter]
34+
args: [--negate, --multiline]
3635
entry: '%load_ext watermark.*%watermark -n -u -v -iv -w'
3736
language: pygrep
38-
args: [--negate, --multiline]
3937
minimum_pre_commit_version: 2.8.0
38+
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Wiki)
39+
types: [jupyter]
4040
- id: check-toc
41+
entry: python scripts/check_toc_is_complete.py
42+
language: python
4143
name: Check all notebooks appear in table of contents
4244
types: [jupyter]
43-
entry: python scripts/check_toc_is_complete.py
45+
- id: check-no-tests-are-ignored
46+
entry: python scripts/check_all_tests_are_covered.py
47+
files: ^\.github/workflows/pytest\.yml$
4448
language: python
49+
name: Check no tests are ignored
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from pathlib import Path
2+
3+
import re
4+
5+
if __name__ == "__main__":
6+
pytest_ci_job = Path(".github") / "workflows/pytest.yml"
7+
txt = pytest_ci_job.read_text()
8+
ignored_tests = set(re.findall(r"(?<=--ignore=)(pymc3/tests.*\.py)", txt))
9+
non_ignored_tests = set(re.findall(r"(?<!--ignore=)(pymc3/tests.*\.py)", txt))
10+
assert (
11+
ignored_tests <= non_ignored_tests
12+
), f"The following tests are ignored by the first job but not run by the others: {ignored_tests.difference(non_ignored_tests)}"

0 commit comments

Comments
 (0)