Description
After a migration from a custom config file pytest-benchmark.ini:
[pytest]
python_files = bench_*.py
python_classes = Bench
python_functions = bench_*
addopts =
--strict-markers
--benchmark-warmup=on
--benchmark-warmup-iterations=10000
--benchmark-timer=time.process_time
--benchmark-time-unit=us
--benchmark-min-time=0.000002
--benchmark-sort=fullname
--benchmark-disable-gc
minversion = 7.4
testpaths = benchmarks
... to pytest-benchmark.toml with the help of the documentation:
[pytest]
minversion = "9.0"
python_files = ["bench_*.py"]
python_classes = ["Bench"]
python_functions = ["bench_*"]
strict_config = true
strict_markers = true
strict_parametrization_ids = true
addopts = [
"--benchmark-warmup=on",
"--benchmark-warmup-iterations=10000",
"--benchmark-timer=time.process_time",
"--benchmark-time-unit=us",
"--benchmark-min-time=0.000002",
"--benchmark-sort=fullname",
"--benchmark-disable-gc",
]
testpaths = ["benchmarks"]
... launching pytest -c pytest-benchmark.toml --collect-only ignores the benchmark files defined and uses the default configuration values.
I tried to put the configuration in [tool.pytest] and it worked:
- [pytest]
+ [tool.pytest]
minversion = "9.0"
python_files = ["bench_*.py"]
python_classes = ["Bench"]
python_functions = ["bench_*"]
strict_config = true
strict_markers = true
strict_parametrization_ids = true
addopts = [
"--benchmark-warmup=on",
"--benchmark-warmup-iterations=10000",
"--benchmark-timer=time.process_time",
"--benchmark-time-unit=us",
"--benchmark-min-time=0.000002",
"--benchmark-sort=fullname",
"--benchmark-disable-gc",
]
testpaths = ["benchmarks"]
Environment
Description
After a migration from a custom config file
pytest-benchmark.ini:... to
pytest-benchmark.tomlwith the help of the documentation:... launching
pytest -c pytest-benchmark.toml --collect-onlyignores the benchmark files defined and uses the default configuration values.I tried to put the configuration in
[tool.pytest]and it worked:Environment