Skip to content

Allure-pytest: report.longrepr information just available in allure web app if test fails with an exception #558

@jaimedelreyg

Description

@jaimedelreyg

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Allure-pytest plugin just show failure information if the test throws an exception.

def pytest_runtest_makereport(self, item, call):
uuid = self._cache.get(item.nodeid)
report = (yield).get_result()
test_result = self.allure_logger.get_test(uuid)
status = get_pytest_report_status(report)
status_details = None
if call.excinfo:
message = escape_non_unicode_symbols(call.excinfo.exconly())
if hasattr(report, 'wasxfail'):
reason = report.wasxfail
message = ('XFAIL {}'.format(reason) if reason else 'XFAIL') + '\n\n' + message
trace = escape_non_unicode_symbols(report.longreprtext)
status_details = StatusDetails(
message=message,
trace=trace)
if (status != Status.SKIPPED
and not (call.excinfo.errisinstance(AssertionError)
or call.excinfo.errisinstance(pytest.fail.Exception))):
status = Status.BROKEN

What is the motivation / use case for changing the behavior?

Some useful plugins, like pytest-check, allow a non-fatal assertion behaviour modifying "report.longrepr" variable. "report.longrepr" could be valuable to get extra information in case of fail without exception information.

Please tell us about your environment:

  • Allure version: 2.13.8
  • Test framework: pytest@6.2.2
  • Allure adaptor: allure-pytest@2.8.32

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions