Verified Commit e5254adb authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add pytest hooks and config

parent 6b31ce3c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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:

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)