There is a test file with a global marker for each stored test:
from pytest import mark
pytestmark = mark.unit
This works as expected and all of the tests from this file as marked as unit. However, I'd like to override the mark for a single test, so that it no longer has the unit marker.
When I use the decorator on the test function that I want to modify, instead of overriding the original marker, it contains both unit and the new integration markers:
@mark.integration
def test_integration():
pass
I've checked the marker decorator sources and it seems that it calls store_mark and has no additional properties that would let me override existing test markers.
Are there any idiomatic solutions to override existing testing marks or should I just store the tests in a separate file?