Skip to content

How to run a selection of cases in a parameterized test? #10322

Discussion options

You must be logged in to vote

The -k option is pretty close to what you want. It just does a substring search, so it's not quite as powerful as a wildcard, but it can easily distinguish between foo and bar in the example you gave:

$ pytest test.py -k foo
...
======================= 3 passed, 3 deselected in 0.03s ========================

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alanmcruickshank
Comment options

Answer selected by alanmcruickshank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants