Skip to content

Commit ed09493

Browse files
Merge pull request #2966 from VWS-Python/use-pytest-beartype-tests-plugin
Use pytest-beartype-tests plugin
2 parents e652af8 + 95b5a46 commit ed09493

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from pathlib import Path
88

99
import pytest
10-
from beartype import beartype
1110
from mock_vws import MockVWS
1211
from mock_vws.database import CloudDatabase
1312
from sybil import Sybil
@@ -18,14 +17,6 @@
1817
)
1918

2019

21-
@beartype
22-
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
23-
"""Apply the beartype decorator to all collected test functions."""
24-
for item in items:
25-
if isinstance(item, pytest.Function):
26-
item.obj = beartype(obj=item.obj)
27-
28-
2920
@pytest.fixture(name="make_image_file")
3021
def fixture_make_image_file(
3122
*,

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ optional-dependencies.dev = [
6161
"pyroma==5.0.1",
6262
"pytest==9.0.3",
6363
"pytest-asyncio==1.3.0",
64+
"pytest-beartype-tests",
6465
"pytest-cov==7.1.0",
6566
"pyyaml==6.0.3",
6667
"ruff==0.15.11",
@@ -93,6 +94,9 @@ optional-dependencies.release = [ "check-wheel-contents==0.6.3" ]
9394
urls.Documentation = "https://vws-python.github.io/vws-python/"
9495
urls.Source = "https://github.com/VWS-Python/vws-python"
9596

97+
[dependency-groups]
98+
dev = []
99+
96100
[tool.setuptools]
97101
zip-safe = false
98102
package-data.vws = [
@@ -114,6 +118,7 @@ bdist_wheel.universal = true
114118
version_scheme = "post-release"
115119

116120
[tool.uv]
121+
sources.pytest-beartype-tests = { git = "https://github.com/adamtheturtle/pytest-beartype-tests.git", rev = "bc81d99" }
117122
sources.torch = { index = "pytorch-cpu" }
118123
sources.torchvision = { index = "pytorch-cpu" }
119124
index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]
@@ -364,7 +369,6 @@ ignore_names = [
364369
"HTTPXTransport",
365370
# pytest configuration
366371
"pytest_collect_file",
367-
"pytest_collection_modifyitems",
368372
"pytest_plugins",
369373
# pytest fixtures - we name fixtures like this for this purpose
370374
"fixture_*",

0 commit comments

Comments
 (0)