from pytest import mark
class TestA:
@mark.parametrize("value", [1, 2])
@staticmethod
def test_foo(value: int):
"""doesn't work"""
@staticmethod
@mark.parametrize("value", [1, 2])
def test_bar(value: int):
"""works"""
output of pytest --collect-only:
<Module test_foo.py>
<Class TestA>
<Function test_foo>
<Function test_bar[1]>
<Function test_bar[2]>
pytest 8.3.3
it should ideally work for both, but if that's not feasible it should at least raise an exception saying that the decorators are in the wrong order
pip listfrom the virtual environment you are using (not using pip)output of
pytest --collect-only:pytest 8.3.3
it should ideally work for both, but if that's not feasible it should at least raise an exception saying that the decorators are in the wrong order