From 71c9ffa7dbfca06ed969fe7a37e528481b51c81c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 27 Mar 2024 16:54:21 -0400 Subject: [PATCH] Support pytest_bdd 7.1.2 and later Fix #1875. --- tests/lib/when_steps.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/lib/when_steps.py b/tests/lib/when_steps.py index 71252f866..b6beab113 100644 --- a/tests/lib/when_steps.py +++ b/tests/lib/when_steps.py @@ -7,7 +7,12 @@ 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