diff --git a/conftest.py b/conftest.py index 1d776f8d..15b489ec 100644 --- a/conftest.py +++ b/conftest.py @@ -9,7 +9,6 @@ from pathlib import Path import pytest -from beartype import beartype from mock_vws import MockVWS from mock_vws.database import VuforiaDatabase from sybil import Sybil @@ -20,15 +19,6 @@ ) -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( high_quality_image: io.BytesIO, diff --git a/pyproject.toml b/pyproject.toml index d3d24c83..58cbd5f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ optional-dependencies.dev = [ "pyright==1.1.405", "pyroma==5.0", "pytest==8.4.2", + "pytest-beartype>=0.2.0", "pytest-cov==7.0.0", "pyyaml==6.0.2", "ruff==0.13.0", @@ -316,6 +317,7 @@ max_supported_python = "3.13" xfail_strict = true log_cli = true +addopts = "--beartype-packages=tests" [tool.coverage.run] diff --git a/tests/test_vws.py b/tests/test_vws.py index e16eff55..5f8e9ea9 100644 --- a/tests/test_vws.py +++ b/tests/test_vws.py @@ -36,7 +36,7 @@ class TestAddTarget: ) @pytest.mark.parametrize(argnames="active_flag", argvalues=[True, False]) def test_add_target( - vws_client: VWS, + vws_client: int, image: io.BytesIO | BinaryIO, application_metadata: bytes | None, cloud_reco_client: CloudRecoService,