Skip to content

Commit e027adc

Browse files
committed
fix(pytest): fixture title issue in pytest>=8.4
1 parent 3cd731a commit e027adc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

allure-pytest/src/helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class AllureTitleHelper:
1010
def decorate_as_title(self, test_title):
1111
def decorator(func):
1212
# pytest.fixture wraps function, so we need to get it directly
13-
if getattr(func, '__pytest_wrapped__', None):
13+
if hasattr(func, "_get_wrapped_function"): # pytest >= 8.4
14+
function = func._get_wrapped_function()
15+
elif hasattr(func, "__pytest_wrapped__"): # pytest < 8.4
1416
function = func.__pytest_wrapped__.obj
1517
else:
1618
function = func

0 commit comments

Comments
 (0)