-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Re-allow simple class::test selection via "-k" #765
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
Comments
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): I agree it would be interesting to support this feature out of the box... not sure another option is the better UI, as a user I prefer to just have to remember one of the options. |
Original comment by BitBucket: pchambon, GitHub: pchambon: I haven't studied the code yet, but I guess a simple string operation replacing "test_abstract_processing.py::TestUserRetriever::test_user_retrieval" by "(test_abstract_processing.py and TestUserRetriever and test_user_retrieval)" would do the trick, right ? |
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): I also haven't studied the code, but if you are willing to work on a PR you're more than welcome! 😄 |
Original comment by BitBucket: pchambon, GitHub: pchambon: I've done a quick POC with regexes, I'll have a look at doing a proper PR with additional tests.
|
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): Thanks, please post here if you have any questions on how to properly test this. |
Original comment by BitBucket: pchambon, GitHub: pchambon: Hum, are pytest tests supposed to run on windows ?
|
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): Yes, it runs on Windows just fine... in a virtualenv, this should be enough: $ pip install tox
$ tox -e py27,py34,flakes |
Original comment by BitBucket: pchambon, GitHub: pchambon: Ok thanks, it eventually worked, it seems that the fact that the dev "_pytest" was directly importable in my python2 screwed things up. I've done a PR, realized too late that it was on "default" branch, I hope it can work still (else just tell me) : |
This was implemented in PR #806 but it was decided to not cover this in -k as test ID is already suitably covered. |
Originally reported by: BitBucket: pchambon, GitHub: pchambon
Long ago, it was possible to simply copy-paste the name of a failed test (in the form MyClass.my_test"), from the output of a run, to rerun only that tests thanks to the "-k" option.
Now that the "-k" has much evolved, one is forced to rewrite with spaces and logical operators, which is quite unhandy when going through a heavy test suite with miscellaneous failing tests.
I see that the new output uses double dots instead:
"test_abstract_processing.py::TestUserRetriever::test_user_retrieval"
Wouldn't it then be a good idea to automatically recognize that alternative syntax in the "-k" option, or even in another option dedicated for that ?
The text was updated successfully, but these errors were encountered: