diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 3d1ebb5..3393ed8 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d639534..312084d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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" diff --git a/noxfile.py b/noxfile.py index 94548e3..f4b38a4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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 `: @@ -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`.