Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions allure-pytest-bdd/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def pytest_configure(config):

pytest_bdd_listener = PytestBDDListener()
config.pluginmanager.register(pytest_bdd_listener)
allure_commons.plugin_manager.register(pytest_bdd_listener)
config.add_cleanup(cleanup_factory(pytest_bdd_listener))

file_logger = AllureFileLogger(report_dir, clean)
allure_commons.plugin_manager.register(file_logger)
Expand Down
10 changes: 10 additions & 0 deletions allure-pytest-bdd/src/pytest_bdd_listener.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import pytest
import allure_commons
from allure_commons.utils import now
from allure_commons.utils import uuid4
from allure_commons.model2 import Label
from allure_commons.model2 import Status

Expand Down Expand Up @@ -110,3 +112,11 @@ def pytest_runtest_makereport(self, item, call):

if report.when == 'teardown':
self.lifecycle.write_test_case(uuid=uuid)

@allure_commons.hookimpl
def attach_data(self, body, name, attachment_type, extension):
self.lifecycle.attach_data(uuid4(), body, name=name, attachment_type=attachment_type, extension=extension)

@allure_commons.hookimpl
def attach_file(self, source, name, attachment_type, extension):
self.lifecycle.attach_file(uuid4(), source, name=name, attachment_type=attachment_type, extension=extension)