diff --git a/conftest.py b/conftest.py index 93484cd3e..72eedd78c 100644 --- a/conftest.py +++ b/conftest.py @@ -12,15 +12,6 @@ from tests.mock_vws.utils.retries import RETRY_EXCEPTIONS - -@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_collect_file = Sybil( parsers=[ DocTestParser(optionflags=ELLIPSIS), diff --git a/pyproject.toml b/pyproject.toml index 293256d0d..ec141ca87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,7 @@ optional-dependencies.dev = [ "pyright==1.1.408", "pyroma==5.0.1", "pytest==9.0.3", + "pytest-beartype-tests", "pytest-retry==1.7.0", "pytest-xdist==3.8.0", "pyyaml==6.0.3", @@ -114,6 +115,9 @@ optional-dependencies.release = [ "check-wheel-contents==0.6.3" ] urls.Documentation = "https://vws-python.github.io/vws-python-mock/" urls.Source = "https://github.com/VWS-Python/vws-python-mock" +[dependency-groups] +dev = [] + [tool.setuptools] zip-safe = false package-data.mock_vws = [ @@ -141,6 +145,7 @@ fallback_version = "0.0.0" 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 } ]