File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- .PHONY : default install format fix ruff-check mypy-check check test doc publish clean
1+ .PHONY : default install format fix ruff-check mypy-check check benchmark-test integration-test property-test unit-test test doc publish clean
22
33UV := $(shell command -v uv 2>/dev/null || true)
44ifeq ($(UV ) ,)
55$(warning uv not found. Install uv (curl -LsSf https ://astral.sh/uv/install.sh | sh) to use Makefile targets)
66endif
77
88default :
9- @echo " Usage: make [install|format|fix|ruff-check|mypy-check|check|test|doc|publish|clean]"
9+ @echo " Usage: make [install|format|fix|ruff-check|mypy-check|check|benchmark-test|integration-test|property-test|unit-test| test|doc|publish|clean]"
1010 @exit 1
1111
1212install :
@@ -29,6 +29,18 @@ check:
2929 make ruff-check
3030 make mypy-check
3131
32+ benchmark-test :
33+ uv run --group tests --locked pytest -m perf
34+
35+ integration-test :
36+ uv run --group tests --locked pytest -m integration
37+
38+ property-test :
39+ uv run --group tests --locked pytest -m property
40+
41+ unit-test :
42+ uv run --group tests --locked pytest -m unit
43+
3244test :
3345 uv run --group tests --locked pytest
3446
Original file line number Diff line number Diff line change @@ -13,12 +13,16 @@ if "%1"=="fix" goto fix
1313if " %1 " == " ruff-check" goto ruff-check
1414if " %1 " == " mypy-check" goto mypy-check
1515if " %1 " == " check" goto check
16+ if " %1 " == " benchmark-test" goto benchmark-test
17+ if " %1 " == " integration-test" goto integration-test
18+ if " %1 " == " property-test" goto property-test
19+ if " %1 " == " unit-test" goto unit-test
1620if " %1 " == " test" goto test
1721if " %1 " == " doc" goto doc
1822if " %1 " == " publish" goto publish
1923if " %1 " == " clean" goto clean
2024
21- echo Usage: make.bat [install^ |format^ |fix^ |ruff-check^ |mypy-check^ |check^ |test^ |doc^ |publish^ |clean]
25+ echo Usage: make.bat [install^ |format^ |fix^ |ruff-check^ |mypy-check^ |check^ |benchmark-test ^ |integration-test ^ |property-test ^ |unit-test ^ | test^ |doc^ |publish^ |clean]
2226exit /b 1
2327
2428:install
@@ -50,6 +54,22 @@ if errorlevel 1 exit /b %errorlevel%
5054call :mypy-check
5155exit /b %errorlevel%
5256
57+ :benchmark-test
58+ uv run --group tests --locked pytest -m perf
59+ exit /b %errorlevel%
60+
61+ :integration-test
62+ uv run --group tests --locked pytest -m integration
63+ exit /b %errorlevel%
64+
65+ :property-test
66+ uv run --group tests --locked pytest -m property
67+ exit /b %errorlevel%
68+
69+ :unit-test
70+ uv run --group tests --locked pytest -m unit
71+ exit /b %errorlevel%
72+
5373:test
5474uv run --group tests --locked pytest
5575exit /b %errorlevel%
Original file line number Diff line number Diff line change 88
99
1010def pytest_collection_modifyitems (
11+ config : pytest .Config ,
1112 items : list [pytest .Item ],
1213) -> None :
13- """Apply the 'perf' marker to all tests collected from this directory."""
14+ """Apply the 'perf' marker to all tests collected from this directory.
15+
16+ Benchmarks require a running JVM and are slow, so they're opt-in: skipped
17+ unless explicitly selected with ``-m perf`` (or a markexpr referencing it).
18+ """
1419 benchmarks_dir = Path (__file__ ).parent
20+ run_perf = "perf" in config .getoption ("markexpr" )
21+ skip_perf = pytest .mark .skip (reason = "Benchmarks are opt-in, run with -m perf to include them." )
1522 for item in items :
1623 if item .path .is_relative_to (benchmarks_dir ):
1724 item .add_marker (pytest .mark .perf )
25+ if not run_perf :
26+ item .add_marker (skip_perf )
You can’t perform that action at this time.
0 commit comments