Support pytest_bdd 7.1.2 and later (#1878)

* Support pytest_bdd 7.1.2 and later

Fix #1875.

* Prevent use of pytest 8.1 for now due to unrelated error

* poetry lock --no-update

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
Ben Beasley 2024-03-28 11:08:00 -04:00 committed by GitHub
parent 2af05e4008
commit 48b61f6953
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 24 deletions

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