Reputation: 554
I'm use pytest with some parameterized tests. However, in more recent versions of pytest with keywords matching becoming more complex I can't figure out how to match a specific paramterization of the test.
If I run my tests they look like
test_abc[backend_generator0-1]
test_abc[backend_generator0-2]
etc. But I can't figure out how to run a specific test parameterization.
pytest -k "test_abc[backend_generator0-2]"
gives Syntax Error
test_simple_delay[backend_generator1not 2]
I've tried various attempts at escaping the -
to match only the specific test but without success.
This python 2.7 on pytest 2.3.5
Upvotes: 1
Views: 1349
Reputation: 56
You don't need -k
or escapes for this. Use the node ID directly:
py.test 'test_abc[backend_generator0-1]'
Upvotes: 2