Note: As my knowledge of pytest-internals is very limited (to basically zero), I can't say much more than "works on my machine".
The code is inspired from what pytest itself does in the junitxml reporter. The relevant code seems to be (from src/_pytest/junitxml.py in function pytest_runtest_logreport):
for propname, propvalue in report.user_properties:
reporter.add_property(propname, str(propvalue))
Note: As my knowledge of pytest-internals is very limited (to basically zero), I can't say much more than "works on my machine".
The code is inspired from what pytest itself does in the junitxml reporter. The relevant code seems to be (from
src/_pytest/junitxml.py
in functionpytest_runtest_logreport
):