You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, great work on this plugin. We were using an older xml format and this has made things way nicer.
I am looking for a way to add markers of each node into the report. Right now I have implemented this like so:
defpytest_sessionfinish(session):
""" A hook called after running all tests and collecting results. """# Bail out early if we aren't generating the json report.ifnotsession.config.getoption('json_report'):
return# get the json report and add a dict of {marker_name: [node, ...]}report=session.config._json_report.reportout=collections.defaultdict(list)
foriteminsession.items:
formarkerinitem.iter_markers():
out[marker.name].append(item.nodeid)
report['markers'] =dict(out)
but there is probably a better way. For me, it is important to collect markers for all tests, even the skipped ones. Would adding something about markers to the default output be worthwhile?
The text was updated successfully, but these errors were encountered:
Unless I had overlooked it back then, historically a node's markers were only provided as strings within the list of keywords.
Now that they are available as separate structures and easily iterable, there is a strong case for providing an explicit markers member for test items in the JSON report. So thanks for pointing that out!
Hi,
First, great work on this plugin. We were using an older xml format and this has made things way nicer.
I am looking for a way to add markers of each node into the report. Right now I have implemented this like so:
but there is probably a better way. For me, it is important to collect markers for all tests, even the skipped ones. Would adding something about markers to the default output be worthwhile?
The text was updated successfully, but these errors were encountered: