@pytest.mark.order(after) a parameterized function #136
Answered
by
mrbean-bremen
GijsPampiermole
asked this question in
Q&A
|
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: |
Answered by
mrbean-bremen
Aug 9, 2024
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? |
0 replies
|
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():
passThe order of tests I want to achieve is:
I hope this is enough information :D |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!