diff --git a/allure-pytest-bdd/src/pytest_bdd_listener.py b/allure-pytest-bdd/src/pytest_bdd_listener.py index 7ec47492..45b5460f 100644 --- a/allure-pytest-bdd/src/pytest_bdd_listener.py +++ b/allure-pytest-bdd/src/pytest_bdd_listener.py @@ -5,7 +5,7 @@ from allure_commons.model2 import Label from allure_commons.model2 import Status -from allure_commons.types import LabelType +from allure_commons.types import LabelType, AttachmentType from allure_commons.utils import platform_label from allure_commons.utils import host_tag, thread_tag from allure_commons.utils import md5 @@ -115,6 +115,9 @@ def pytest_runtest_makereport(self, item, call): test_result.status = status test_result.statusDetails = status_details + if test_result.status != Status.PASSED and report.caplog: + self.attach_data(report.caplog, "log", AttachmentType.TEXT, None) + if report.when == 'teardown': self.lifecycle.write_test_case(uuid=uuid)