Closed ricwal-richa closed 4 years ago
I have reproduced the issue and found out the cause of it by looking into pytest_runtest_makereport method. It seems reduce function does not work as expected.
status = reduce(lambda final_status, current_status: final_status or getattr(report, current_status, None),
["failed", "passed", "skipped"])
I have changed that piece of code with method from allure-pytest:
def get_pytest_report_status(pytest_report):
pytest_statuses = ('failed', 'passed', 'skipped')
statuses = (Status.FAILED, Status.PASSED, Status.SKIPPED)
for pytest_status, status in zip(pytest_statuses, statuses):
if getattr(pytest_report, pytest_status):
return status
And now it works fine.
thanks @fundakol the fix works for me. Awaiting branch merge.
[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )
I'm submitting a ...
What is the current behavior?
When generating an allure report for pytest-bdd test; the report shows test feature marked as Fail although all steps in the test are marked as Pass. The test is using Scenario Outline and running for 12 data sets.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Create a test in pytest-bdd feature file. sample from my test -
pytest --activedir=<absolute path to report folder>
What is the expected behavior?
Feature status should be marked as 'Pass' when all steps inside the test are 'Pass'.
What is the motivation / use case for changing the behavior?
Bug Fix
Please tell us about your environment:
Other information
. When same test is executed and report is generated using pytest-html, all tests show as Pass.
. Allure report screenshot