Closed storenth closed 1 year ago
Hi, @storenth !
If a fixture fails, the test body is not executed by pytest, hence the allyre.dynamic.title
function has no chance to change the title.
You can use @allure.title
decorator instead, it has access to parameter values:
import allure
import pytest
@pytest.fixture
def failing_fixture():
raise ValueError("Fixture failed")
@allure.title("{title}")
@pytest.mark.parametrize("title", ["First test", "Second test"])
def test_issue730_reproduction(failing_fixture, title):
pass
Yes, it helps.
You're welcome!
Describe the bug No appropriate title in case of test's fixture fail
To Reproduce
allure.dynamic.title
based on parametrized titleExpected behavior Title of the failed test same as title in param
Screenshots Normally passed test:
Test failed in test body (like
assert False
statement inside thetest_case()
):Actual behavior Test failed in any fixture passed to the
test_case(failed_fixture)
:Source code example including
allure.dynamic.title
with test params and fixtures:Environment: