@pytest.mark.order(after) a parameterized function #136
-
Hi, I've had a look around the internet, and tried lots of different things. Despite I cant seem to figure out how to use Example:
Expected/Requested result:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Parametrized functions are not fully supported (yet), see #55. That having said, can you show the example code that you want to order? |
Beta Was this translation helpful? Give feedback.
-
This would be my current code, stripped down from everything def test_create():
pass
@pytest.mark.order(after="test_create")
@pytest.mark.order(after="test_update[description]")
def test_get():
pass
@pytest.mark.order(after="test_get")
@pytest.mark.parametrize("key", ["name"], ["description"])
def test_update(key):
pass
@pytest.mark.order(after="test_get[test_get[description]]")
def test_delete():
pass The order of tests I want to achieve is:
I hope this is enough information :D |
Beta Was this translation helpful? Give feedback.
Ok, this is actually possible. What is not possible is to handle the parametrized tests separately (as you have tried), instead you just have to use the name without the id for the parametrized test:
I have to admit that I didn't know that tests that are running more than once are referenced this way - learned something new!