Skip to content

How to add pytest collection errors to allure report #2987

Discussion options

You must be logged in to vote

Hi, @cml8ds

Allure-pytest follows the lifecycle of pytest and pytest doesn't run tests from modules with collection errors: if no tests are collected, there is nothing to run, hence, no results.

The best you can do is to create surrogate test results to show collection errors in the report. Something like this should do the trick:

import pytest
from allure_commons import plugin_manager
from allure_commons.model2 import Label
from allure_commons.model2 import Status
from allure_commons.model2 import StatusDetails
from allure_commons.model2 import TestResult
from allure_commons.utils import host_tag
from allure_commons.utils import md5
from allure_commons.utils import now
from allure_commons.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cml8ds
Comment options

Answer selected by cml8ds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants