Skip to content

Python 3.13 and pytest-bdd give "PytestWarning: usefixtures() in TESTNAME without arguments has no effect" #802

@jzohrab

Description

@jzohrab

My project uses the above combo of tech, and as of python 3.13 I'm getting the above error, e.g.:

.venv313/lib/python3.13/site-packages/pytest_bdd/scenario.py:268
  .venv313/lib/python3.13/site-packages/pytest_bdd/scenario.py:268: PytestWarning: usefixtures() in tests/acceptance/test_reading.py::test_peeking_at_page_does_not_set_current_page_or_start_date without arguments has no effect
    @pytest.mark.usefixtures(*func_args)

The test_reading.py bdd file is just this:

from pytest_bdd import scenarios
scenarios("reading.feature")

and the scenario file is a regular .feature file, which I can provide if needed.

I don't use usefixtures anywhere in my code, but pytest_bdd's scenario.py has the following:

        # We need to tell pytest that the original function requires its fixtures,
        # otherwise indirect fixtures would not work.
        @pytest.mark.usefixtures(*func_args)

I've googled but can't see anything I'm doing wrong. These warnings are new. Guidance appreciated. Thank you for the great project!

Version

  • pytest version: pytest-9.0.2
  • pytest-bdd version: pytest_bdd-7.3.0
  • OS: mac Sonoma 14.5 (23F79)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions