Skip to content

Commit 48ddb4c

Browse files
Merge pull request #3116 from VWS-Python/use-pytest-beartype-tests-plugin
Use pytest-beartype-tests plugin
2 parents ca5dfd3 + 43b5b51 commit 48ddb4c

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212

1313
from tests.mock_vws.utils.retries import RETRY_EXCEPTIONS
1414

15-
16-
@beartype
17-
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
18-
"""Apply the beartype decorator to all collected test functions."""
19-
for item in items:
20-
if isinstance(item, pytest.Function):
21-
item.obj = beartype(obj=item.obj)
22-
23-
2415
pytest_collect_file = Sybil(
2516
parsers=[
2617
DocTestParser(optionflags=ELLIPSIS),

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ optional-dependencies.dev = [
7777
"pyright==1.1.408",
7878
"pyroma==5.0.1",
7979
"pytest==9.0.3",
80+
"pytest-beartype-tests",
8081
"pytest-retry==1.7.0",
8182
"pytest-xdist==3.8.0",
8283
"pyyaml==6.0.3",
@@ -114,6 +115,9 @@ optional-dependencies.release = [ "check-wheel-contents==0.6.3" ]
114115
urls.Documentation = "https://vws-python.github.io/vws-python-mock/"
115116
urls.Source = "https://github.com/VWS-Python/vws-python-mock"
116117

118+
[dependency-groups]
119+
dev = []
120+
117121
[tool.setuptools]
118122
zip-safe = false
119123
package-data.mock_vws = [
@@ -141,6 +145,7 @@ fallback_version = "0.0.0"
141145
version_scheme = "post-release"
142146

143147
[tool.uv]
148+
sources.pytest-beartype-tests = { git = "https://github.com/adamtheturtle/pytest-beartype-tests.git", rev = "bc81d99" }
144149
sources.torch = { index = "pytorch-cpu" }
145150
sources.torchvision = { index = "pytorch-cpu" }
146151
index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]

0 commit comments

Comments
 (0)