diff --git a/conftest.py b/conftest.py index d9e95510..8e5442cf 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,6 @@ from pathlib import Path import pytest -from beartype import beartype from mock_vws import MockVWS from mock_vws.database import CloudDatabase from sybil import Sybil @@ -18,14 +17,6 @@ ) -@beartype -def pytest_collection_modifyitems(items: list[pytest.Item]) -> None: - """Apply the beartype decorator to all collected test functions.""" - for item in items: - if isinstance(item, pytest.Function): - item.obj = beartype(obj=item.obj) - - @pytest.fixture(name="make_image_file") def fixture_make_image_file( *, diff --git a/pyproject.toml b/pyproject.toml index 6d5ce09a..933b59d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,7 @@ optional-dependencies.dev = [ "pyroma==5.0.1", "pytest==9.0.3", "pytest-asyncio==1.3.0", + "pytest-beartype-tests", "pytest-cov==7.1.0", "pyyaml==6.0.3", "ruff==0.15.11", @@ -93,6 +94,9 @@ optional-dependencies.release = [ "check-wheel-contents==0.6.3" ] urls.Documentation = "https://vws-python.github.io/vws-python/" urls.Source = "https://github.com/VWS-Python/vws-python" +[dependency-groups] +dev = [] + [tool.setuptools] zip-safe = false package-data.vws = [ @@ -114,6 +118,7 @@ bdist_wheel.universal = true version_scheme = "post-release" [tool.uv] +sources.pytest-beartype-tests = { git = "https://github.com/adamtheturtle/pytest-beartype-tests.git", rev = "bc81d99" } sources.torch = { index = "pytorch-cpu" } sources.torchvision = { index = "pytorch-cpu" } index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ] @@ -364,7 +369,6 @@ ignore_names = [ "HTTPXTransport", # pytest configuration "pytest_collect_file", - "pytest_collection_modifyitems", "pytest_plugins", # pytest fixtures - we name fixtures like this for this purpose "fixture_*",