pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

help in handling error case from report attribute using the pytest-html plugin

Open madhav-pai opened this issue 3 years ago • 1 comments

i need help in the way pytest_runtest_makereport handles error

pytest_html = item.config.pluginmanager.getplugin("html")
report = outcome.get_result()
extra = getattr(report, "extra", [])
LOG.info(f"Now in test {item.nodeid} {call.when}")
error = hasattrb(report, "waserror")

am unable to get the error variable to true even though i have a error test and have a logger statement when i print call.when in setup/call/teardown. am i missing something here ?

madhav-pai avatar Jul 25 '22 10:07 madhav-pai

I need more info to help.

Can you show the entire function and what output you do get?

BeyondEvil avatar Jul 25 '22 19:07 BeyondEvil

Closing this for lack of interaction. Feel free to re-open.

BeyondEvil avatar Mar 05 '23 16:03 BeyondEvil