-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
topic: marksrelated to marks, either the general marks or builtinrelated to marks, either the general marks or builtin
Milestone
Description
Not entirely sure if it would be considered a bug, but it surprised me. I expect iter_markers
to return the markers in bottom-to-top order (outwards from the test), but for the pytestmark
variable this is not the case, it returns them in the list order.
import pytest
pytestmark = [
pytest.mark.order(4),
pytest.mark.order(3),
]
@pytest.mark.order(2)
@pytest.mark.order(1)
def test_marker(request):
lowest = 0
for mark in request.node.iter_markers("order"):
order = mark.args[0]
assert order > lowest
lowest = order
FAILED test_marker.py::test_marker - assert 3 > 4
I expect this will also apply for pytestmark
as a class variable.
Metadata
Metadata
Assignees
Labels
topic: marksrelated to marks, either the general marks or builtinrelated to marks, either the general marks or builtin
Type
Projects
Status
To do