Skip to content

Commit

Permalink
Remove doctests from pre-commit. Add them to test_pr.yml. Check .pyi …
Browse files Browse the repository at this point in the history
…files.
  • Loading branch information
aliddell committed Nov 15, 2023
1 parent b6fbf45 commit 565c78e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: Test
run: |
python -m pytest -k test_basic --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
python -m pytest -k test_docs --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
dcam:
name: Python ${{ matrix.python }} (DCAM)
Expand Down Expand Up @@ -98,7 +99,7 @@ jobs:
- name: Test
run: |
python -m pytest -k test_dcam --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
python -m pytest -k test_dcam --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0 --doctest-glob="*.pyi" --doctest-glob="*.md"
egrabber:
name: Python ${{ matrix.python }} (eGrabber)
Expand Down Expand Up @@ -144,8 +145,7 @@ jobs:
- name: Test
run: |
python -m pytest -k test_egrabber --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
python -m pytest -k test_egrabber --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0 --doctest-glob="*.pyi" --doctest-glob="*.md"
spinnaker:
name: Python ${{ matrix.python }} (Spinnaker)
Expand Down
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ repos:
stages: [ manual ]
- repo: local
hooks:
- id: doctest
name: Run doctests
entry: python tests/test_docs.py
language: system
types: [ file ]
files: \.(md|py|rs)$
- id: ruff
name: Lint Python files
entry: python -m ruff check .
Expand Down
9 changes: 3 additions & 6 deletions tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ def test_rust_sources(base_dir):
assert doctest.testfile(str(f), module_relative=False).failed == 0


if __name__ == "__main__":
base = Path(__file__).parent.parent
test_readme(base)
test_modules(base)
test_rust_sources(base)
print("Done.")
def test_pyi_files(base_dir):
for f in base_dir.glob("python/**/*.pyi"):
assert doctest.testfile(str(f), module_relative=False).failed == 0

0 comments on commit 565c78e

Please sign in to comment.