Closed micahellison closed 7 months ago
It looks like version pinning is a bit trickier than I'd thought, I think due to irregularities between how poetry and tox handle pytest plugin versions. Probably better to spend time on just fixing the root cause.
The immediate workaround would be something like:
try:
from pytest_bdd.compat import inject_fixture # since pytest_bdd 7.1.2
except ImportError:
from pytest_bdd.steps import inject_fixture # before pytest_bdd 7.1.2
but perhaps it would be worth considering, in the medium term, whether there is an alternative to using an unsupported function that could move again or disappear.
Alternatively, I guess you could just from pytest_bdd.compat import inject_fixture
and update to pytest_bdd>=7.1.2
.
Diagnostic output
n/a
Current Behavior
Around a week ago, pytest-bdd 7.1.2 was released and all of our PRs started failing tests with this error on
tests/lib/when_steps.py
:Expected Behavior
Tests should be running fine. This patch release of pytest-bdd is a breaking change for us, though.
Repro Steps
pytest-bdd = "7.1.1"
poetry install
andpoetry run pytest
. Everything passes.pytest-bdd = "7.1.2"
poetry install
andpoetry run pytest
. Everything fails.Debug output
n/a
Other Information
I don't have a lot of time to look at this now, and am tempted to pin pytest to 7.1.1 for now just to be able to get through PRs, though if a contributor has a fix for this, it would be welcome.