File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from pathlib import Path
1010
1111import pytest
12- from beartype import beartype
1312from mock_vws import MockVWS
1413from mock_vws .database import VuforiaDatabase
1514from sybil import Sybil
2019)
2120
2221
23- def pytest_collection_modifyitems (items : list [pytest .Item ]) -> None :
24- """
25- Apply the beartype decorator to all collected test functions.
26- """
27- for item in items :
28- if isinstance (item , pytest .Function ):
29- item .obj = beartype (obj = item .obj )
30-
31-
3222@pytest .fixture (name = "make_image_file" )
3323def fixture_make_image_file (
3424 high_quality_image : io .BytesIO ,
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ optional-dependencies.dev = [
5757 " pyright==1.1.405" ,
5858 " pyroma==5.0" ,
5959 " pytest==8.4.2" ,
60+ " pytest-beartype>=0.2.0" ,
6061 " pytest-cov==7.0.0" ,
6162 " pyyaml==6.0.2" ,
6263 " ruff==0.13.0" ,
@@ -316,6 +317,7 @@ max_supported_python = "3.13"
316317
317318xfail_strict = true
318319log_cli = true
320+ addopts = " --beartype-packages=tests"
319321
320322[tool .coverage .run ]
321323
You can’t perform that action at this time.
0 commit comments