Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use error message for status details of step that does not have exception and is not undefined #650

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions allure-behave/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def scenario_status(scenario):

def scenario_status_details(scenario):
for step in scenario.all_steps:
if step_status(step) != 'passed':
if step.exception or step.error_message or step_status(step) == 'undefined':
return step_status_details(step)


Expand Down Expand Up @@ -120,11 +120,14 @@ def step_status_details(result):
result.exc_traceback)
return StatusDetails(message=format_exception(type(result.exception), result.exception), trace=trace)

elif result.status == 'undefined':
if result.status == 'undefined':
message = '\nYou can implement step definitions for undefined steps with these snippets:\n\n'
message += make_undefined_step_snippet(result)
return StatusDetails(message=message)

if result.error_message:
return StatusDetails(message=result.error_message)


def step_table(step):
table = [','.join(step.table.headings)]
Expand Down