Skip to content
New issue

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

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

Already on GitHub? # to your account

PytestDeprecationWarning: The hookimpl pytest_addhooks uses old-style configuration options #2420

Open
johnkangw opened this issue Feb 10, 2023 · 1 comment
Labels
bug something broken P3 backlog testing automated tests

Comments

@johnkangw
Copy link

johnkangw commented Feb 10, 2023

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                      2.8.1
dash-ag-grid              2.0.0a1
dash-auth                 1.4.1
dash-bootstrap-components 1.2.0
dash-core-components      2.0.0
dash-design-kit           1.6.7
dash-enterprise-auth      0.1.0
dash-html-components      2.0.0
dash-iconify              0.1.2
dash-loading-spinners     1.0.0
dash-mantine-components   0.10.0
dash-snapshots            2.2.2
dash-table                5.0.0
dash-user-analytics       0.0.2

Describe the bug

Pytest deprecation warning from the dash\testing\plugin.py

============================== warnings summary ===============================
.....conda\envs\Capacity_venv\lib\site-packages\dash\testing\plugin.py:83
C:\Users\JKANG1.conda\envs\Capacity_venv\lib\site-packages\dash\testing\plugin.py:83: PytestDeprecationWarning: The hookimpl pytest_addhooks uses old-style configuration options (marks or attributes).
Please use the pytest.hookimpl(tryfirst=True) decorator instead
to configure the hooks.
See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
@pytest.mark.tryfirst
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Expected behavior

No deprecation warning

Screenshots

image

@nickmelnikov82
Copy link
Member

This issue is caused by an outdated way of configuring Hooks in the dash\testing\plugin.py file. To resolve this issue, you need to update the code in this file using the new way of configuring Hooks.

Update the dash\testing\plugin.py file by replacing the following line:

@pytest.mark.tryfirst

with

@pytest.hookimpl(tryfirst=True)

After making these changes, the deprecation messages should disappear and you should no longer receive deprecation warnings when running tests.

Be careful when editing the dash\testing\plugin.py file and make sure you save it with the correct changes. It is also recommended that you create a backup copy of the file before making changes so that you can revert to the original state if necessary.

@gvwilson gvwilson self-assigned this Jul 25, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog bug something broken labels Aug 13, 2024
@gvwilson gvwilson changed the title [BUG] PytestDeprecationWarning: The hookimpl pytest_addhooks uses old-style configuration options (marks or attributes). PytestDeprecationWarning: The hookimpl pytest_addhooks uses old-style configuration options Aug 13, 2024
@gvwilson gvwilson added the testing automated tests label Aug 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug something broken P3 backlog testing automated tests
Projects
None yet
Development

No branches or pull requests

3 participants