ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.24k stars 119 forks source link

Hook configuration via attributes is deprecated in pytest #223

Closed The-Compiler closed 2 years ago

The-Compiler commented 2 years ago

When running this plugin with pytest main, it complains about

https://github.com/ionelmc/pytest-benchmark/blob/4a99afe6e90119f52b1e00d249afe5acbdd4e7f0/src/pytest_benchmark/hookspec.py#L148-L152

with:

pytest.PytestDeprecationWarning: The hookspec pytest_benchmark_generate_commit_info uses old-style configuration options (marks or attributes).
Please use the pytest.hookspec(firstresult=True) decorator instead
 to configure the hooks.

See Deprecations and Removals: Configuring hook specs/impls using markers and https://github.com/pytest-dev/pytest/pull/9118.

The-Compiler commented 2 years ago

Same also for the pytest_configure hookimpl:

https://github.com/ionelmc/pytest-benchmark/blob/4a99afe6e90119f52b1e00d249afe5acbdd4e7f0/src/pytest_benchmark/plugin.py#L437