Skip to content

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

Open

Description

@johnkangw

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

Activity

  1. nickmelnikov82 commented on Jun 16, 2023

    @nickmelnikov82
    Contributor

    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.

  2. self-assigned this
    on Jul 25, 2024
  3. removed their assignment
    on Aug 2, 2024
  4. 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[/+] on Aug 13, 2024
  5. gothicVI commented on Nov 11, 2026

    @gothicVI
    Contributor

    At this point this is no longer a deprecation warning but

      .venv/lib/python3.14/site-packages/dash/testing/plugin.py:104: PytestRemovedIn10Warning: 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
    

    Please take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokentestingautomated tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions