Control the execution order of pytest #8243
Answered
by
RonnyPfannschmidt
ffbh123456
asked this question in
Q&A
-
I have a lot of pytest test cases. I have labeled these cases with different labels A and B through @pytest.mark. I want them to execute all the cases labeled A first, and then execute the cases labeled B, What should I do? |
Beta Was this translation helpful? Give feedback.
Answered by
RonnyPfannschmidt
Jan 16, 2021
Replies: 2 comments
-
The pytest_collection_modifyitems hook can be used to reorder, You have to mark yours try last and then sort the items as you want |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ffbh123456
-
Thank you, it works |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pytest_collection_modifyitems hook can be used to reorder,
You have to mark yours try last and then sort the items as you want