Support pytest_bdd 7.1.2 and later

Fix #1875.
This commit is contained in:
Benjamin A. Beasley 2024-03-27 16:54:21 -04:00
parent 2af05e4008
commit 384977c20a

View file

@ -7,7 +7,13 @@ from contextlib import ExitStack
from pytest_bdd import when
from pytest_bdd.parsers import parse
from pytest_bdd.parsers import re
from pytest_bdd.steps import inject_fixture
# This is an undocumented and unsupported function:
# https://github.com/pytest-dev/pytest-bdd/issues/684
try:
from pytest_bdd.compat import inject_fixture # pytest_bdd 7.1.2 and later
except ImportError:
from pytest_bdd.steps import inject_fixture # pytest_bdd 7.1.1 and earlier
from jrnl.main import run