Check the type annotations at runtime with typeguard #15
3 changed files with 8 additions and 8 deletions
commit
cfd8d33049
|
|
@ -78,8 +78,8 @@ jobs:
|
|||
- name: Run the test suite
|
||||
run: uv run nox -s test
|
||||
|
||||
- name: Run the doctests
|
||||
run: uv run nox -s doctest
|
||||
- name: Test the code snippets in the docstrings with `xdoctest`
|
||||
run: uv run nox -s test-docstrings
|
||||
|
||||
- name: Check the type annotations at runtime with `typeguard`
|
||||
run: uv run nox -s test-types
|
||||
|
|
@ -87,4 +87,4 @@ jobs:
|
|||
- name: Run the `pre-commit` hooks not covered by `nox`
|
||||
run: uv run pre-commit run --all-files --show-diff-on-failure
|
||||
env:
|
||||
SKIP: local-format,local-lint,local-test,local-doctest,local-test-types,no-commit-to-branch
|
||||
SKIP: local-format,local-lint,local-test,local-test-docstrings,local-test-types,no-commit-to-branch
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ repos:
|
|||
always_run: true
|
||||
require_serial: true
|
||||
|
||||
- id: local-doctest
|
||||
- id: local-test-docstrings
|
||||
name: Run the doctests
|
||||
entry: uv run nox -s doctest
|
||||
entry: uv run nox -s test-docstrings
|
||||
language: unsupported
|
||||
stages: [pre-merge-commit]
|
||||
pass_filenames: false # => No `--` at the end of the "entry"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ By default, `uv run nox` runs the sessions that assure code quality:
|
|||
- "format": Format source files with `autoflake`, `black`, `flynt`, `isort`, and `ruff`
|
||||
- "lint": Lint source files with `flake8`, `isort`, `mypy`, `pyright`, and `ruff`
|
||||
- "test": Run the test suite with `pytest`
|
||||
- "doctest": Check if code snippets in the docstrings run
|
||||
- "test-docstrings": Check if code snippets in the docstrings run
|
||||
- "test-types": Run the test suite with runtime type checks by `typeguard`
|
||||
|
||||
Further sessions run on demand with `uv run nox -s <session>`:
|
||||
|
|
@ -151,7 +151,7 @@ nox.options.sessions = (
|
|||
"format",
|
||||
"lint",
|
||||
"test",
|
||||
"doctest",
|
||||
"test-docstrings",
|
||||
"test-types",
|
||||
)
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ def test_code(session: nox.Session) -> None:
|
|||
session.run("pytest", *(session.posargs or pytest_default_args))
|
||||
|
||||
|
||||
@nox.session(name="doctest", python=MAIN_PYTHON)
|
||||
@nox.session(name="test-docstrings", python=MAIN_PYTHON)
|
||||
def test_docstrings(session: nox.Session) -> None:
|
||||
"""Test the code snippets in the docstrings with `xdoctest`.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue