Loading .pre-commit-config.yaml +10 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ repos: types_or: [python, pyi] stages: [commit, manual] - repo: https://code.kodo.org.uk/dom/pre-commit-pytest rev: v1.0 hooks: - id: pytest types_or: [python, markdown] stages: [commit, manual] args: [--doctest-modules, --doctest-continue-on-failure] - id: pytest args: [test.py] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.2 hooks: Loading conftest.py 0 → 100644 +16 −0 Original line number Diff line number Diff line """ Setup and configuration for pytest """ import time from unittest.mock import Mock import pytest @pytest.fixture(autouse=True) def add_time_mock(doctest_namespace: dict[str, object]) -> None: """ Add a doctest mock for `time.sleep()` """ time.sleep = Mock(return_value=None) Loading
.pre-commit-config.yaml +10 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ repos: types_or: [python, pyi] stages: [commit, manual] - repo: https://code.kodo.org.uk/dom/pre-commit-pytest rev: v1.0 hooks: - id: pytest types_or: [python, markdown] stages: [commit, manual] args: [--doctest-modules, --doctest-continue-on-failure] - id: pytest args: [test.py] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.2 hooks: Loading
conftest.py 0 → 100644 +16 −0 Original line number Diff line number Diff line """ Setup and configuration for pytest """ import time from unittest.mock import Mock import pytest @pytest.fixture(autouse=True) def add_time_mock(doctest_namespace: dict[str, object]) -> None: """ Add a doctest mock for `time.sleep()` """ time.sleep = Mock(return_value=None)