Skip to content

Commit 010d63e

Browse files
committed
Use pytest-beartype-tests plugin for test beartype
Replace manual pytest_collection_modifyitems hooks with the https://github.com/adamtheturtle/pytest-beartype-tests dev dependency.
1 parent e652af8 commit 010d63e

2 files changed

Lines changed: 4 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ optional-dependencies.dev = [
8888
"vws-test-fixtures==2023.3.5",
8989
"yamlfix==1.19.1",
9090
"zizmor==1.24.1",
91+
"pytest-beartype-tests==2026.4.19.1",
9192
]
9293
optional-dependencies.release = [ "check-wheel-contents==0.6.3" ]
9394
urls.Documentation = "https://vws-python.github.io/vws-python/"
@@ -364,7 +365,6 @@ ignore_names = [
364365
"HTTPXTransport",
365366
# pytest configuration
366367
"pytest_collect_file",
367-
"pytest_collection_modifyitems",
368368
"pytest_plugins",
369369
# pytest fixtures - we name fixtures like this for this purpose
370370
"fixture_*",
@@ -402,3 +402,6 @@ exclude = [ ".venv" ]
402402
[tool.yamlfix]
403403
section_whitelines = 1
404404
whitelines = 1
405+
406+
[dependency-groups]
407+
dev = []

0 commit comments

Comments
 (0)