Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook configuration via attributes is deprecated in pytest #223

Closed
The-Compiler opened this issue Oct 6, 2022 · 1 comment · Fixed by #224
Closed

Hook configuration via attributes is deprecated in pytest #223

The-Compiler opened this issue Oct 6, 2022 · 1 comment · Fixed by #224

Comments

@The-Compiler
Copy link
Contributor

When running this plugin with pytest main, it complains about

pytest_benchmark_scale_unit.firstresult = True
pytest_benchmark_generate_commit_info.firstresult = True
pytest_benchmark_generate_json.firstresult = True
pytest_benchmark_generate_machine_info.firstresult = True
pytest_benchmark_group_stats.firstresult = True

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 pytest-dev/pytest#9118.

@The-Compiler
Copy link
Contributor Author

Same also for the pytest_configure hookimpl:

@pytest.mark.trylast # force the other plugins to initialise, fixes issue with capture not being properly initialised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant