diff --git a/pyproject.toml b/pyproject.toml index c3e47168..b6ccfaba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ optional-dependencies.dev = [ "pyright==1.1.408", "pyroma==5.0.1", "pytest==9.0.3", + "pytest-beartype-tests", "pytest-cov==7.1.0", "pytest-regressions==2.10.0", "ruff==0.15.11", @@ -83,6 +84,9 @@ urls.Documentation = "https://vws-python.github.io/vws-web-tools/" urls.Source = "https://github.com/VWS-Python/vws-web-tools" scripts.vws-web-tools = "vws_web_tools:vws_web_tools_group" +[dependency-groups] +dev = [] + [tool.setuptools] zip-safe = false package-data.vws_web_tools = [ @@ -103,6 +107,9 @@ bdist_wheel.universal = true # Code to match this is in ``conf.py``. version_scheme = "post-release" +[tool.uv] +sources.pytest-beartype-tests = { git = "https://github.com/adamtheturtle/pytest-beartype-tests.git", rev = "bc81d99" } + [tool.ruff] line-length = 79 lint.select = [ @@ -326,7 +333,6 @@ ignore_path = [ ignore_names = [ # pytest configuration "pytest_collect_file", - "pytest_collection_modifyitems", "pytest_plugins", # pytest fixtures - we name fixtures like this for this purpose "fixture_*", diff --git a/tests/conftest.py b/tests/conftest.py index a5af6707..ab5b7cf9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,6 @@ import os import pytest -from beartype import beartype from tests.credentials import VWSCredentials @@ -15,16 +14,3 @@ def fixture_vws_credentials() -> VWSCredentials: email_address=os.environ["VWS_EMAIL_ADDRESS"], password=os.environ["VWS_PASSWORD"], ) - - -@beartype -def pytest_collection_modifyitems( - session: pytest.Session, - config: pytest.Config, - items: list[pytest.Item], -) -> None: - """Apply the beartype decorator to all collected test functions.""" - del session, config - for item in items: - assert isinstance(item, pytest.Function) - item.obj = beartype(obj=item.obj)