Skip to content

Commit 0ea3572

Browse files
committed
fix pytest group
1 parent 90c4a91 commit 0ea3572

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ all = [
6060
]
6161

6262
[tool.pytest.ini_options]
63+
markers = [
64+
'benchmark_main: marks tests as main benchmarks to run selectively'
65+
]
6366
addopts = [
6467
'--benchmark-columns', 'min,mean,stddev,outliers,rounds,iterations',
6568
'--benchmark-disable', # use --benchmark-enable

pytests/test_dag_cbor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ def test_dag_cbor_decode(benchmark, data) -> None:
101101
_dag_cbor_roundtrip(benchmark, data)
102102

103103

104+
@pytest.mark.benchmark_main
104105
@pytest.mark.parametrize('data', load_json_data_fixtures(_REAL_DATA_DIR), ids=lambda data: data[0])
105106
def test_dag_cbor_encode_real_data(benchmark, data) -> None:
106107
_dag_cbor_encode(benchmark, data)
107108

108109

110+
@pytest.mark.benchmark_main
109111
@pytest.mark.parametrize('data', load_json_data_fixtures(_REAL_DATA_DIR), ids=lambda data: data[0])
110112
def test_dag_cbor_decode_real_data(benchmark, data) -> None:
111113
_dag_cbor_roundtrip(benchmark, data)
@@ -116,6 +118,7 @@ def test_dag_cbor_decode_fixtures(benchmark, data) -> None:
116118
_dag_cbor_decode(benchmark, data)
117119

118120

121+
@pytest.mark.benchmark_main
119122
def test_dag_cbor_decode_torture_cids(benchmark) -> None:
120123
dag_cbor = open(_TORTURE_CIDS_DAG_CBOR_PATH, 'rb').read()
121124
benchmark(libipld.decode_dag_cbor, dag_cbor)

pytests/test_decode_car.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def car() -> bytes:
1414
return load_car_fixture(_DID, _REPO_CAR_PATH)
1515

1616

17+
@pytest.mark.benchmark_main
1718
def test_decode_car(benchmark, car) -> None:
1819
header, blocks = benchmark(libipld.decode_car, car)
1920

0 commit comments

Comments
 (0)