Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-k collects tests with * parameter #3658

Closed
Formartha opened this issue Jul 4, 2018 · 4 comments
Closed

-k collects tests with * parameter #3658

Formartha opened this issue Jul 4, 2018 · 4 comments
Labels
type: question general question, might be closed after 2 weeks of inactivity

Comments

@Formartha
Copy link

Formartha commented Jul 4, 2018

Hi,

during a run of pytest, I discovered that pytest -k option will take all the testcases under a folder and will discover all the names identical to the following case:
TEST_NAME*

Example,

14:55:18 testsuite/ncso/tosca_adaptor/test_tosca_model_distribute.py::test_tosca_model_distribute PASSED [ 50%]
14:55:30 testsuite/ncso/tosca_adaptor/test_tosca_model_distribute_negative.py::test_tosca_model_distribute_negative PASSED [100%]

the command I used is : pipenv run py.test testsuite -k test_tosca_model_distribute

@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #1263 (mapping the fixture parameter with the test method parameter), #1843 (Parameter corruption for parameterized tests), #1123 (does pytest support to this way to collect test cases?), #765 (Re-allow simple class::test selection via "-k"), and #557 (Running a specific test parameter that has '-' causes syntax error).

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jul 4, 2018
@RonnyPfannschmidt RonnyPfannschmidt added type: question general question, might be closed after 2 weeks of inactivity and removed type: bug problem that needs to be addressed labels Jul 4, 2018
@RonnyPfannschmidt
Copy link
Member

keywords match even substrings of test names, its intended to work that way to select tests that contain a certain word at different locations

@Formartha
Copy link
Author

So how can pytest grab specific test case? (exact matching)?

@RonnyPfannschmidt
Copy link
Member

by using the full nodeid like filename.py::the_test

@Zac-HD Zac-HD closed this as completed Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

4 participants