I have multiple pytest scripts that run independently, I want to build a mechanism to add xml attributes to the tests in the script to run in the conftest.py script on collection. So far i've found online a call :
request.config._xml.node_reporter(item.nodeid).add_attribute('spam', 'eggs')
that can be run in the pytest_collection_modifyitems
hook .
but when i try to run this i get:
NameError: name 'request' is not defined
Error Any idea what am i missing?