I have a test file eg: test_my_api.py
And I call the pytest to start executing using below command, to run test only with specific mark
pipenv run pytest -m "integration"
Now in my test_my_api.py file I have multiple functions marked as "integration"
Also I have a global variable configured as below, and using this global value DATA in all methods
DATA = get_my_data()
Now I have another mark called "smoke", now some test cases has both the mark "smoke" and "integration". For smoke i need global data as different as below,
DATA = get_smoke_data()
The issue is while running the test case I can't split for which mark this test case is getting called . i.e for smoke or for integration. How can I get this info in global level ?
Previously I know there was something called Mark info eg: from _pytest.mark import MarkInfo but this is removed now. And this is available only inside every method How can I get it on global level