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
Test selection syntax is baroque and foreign #2193
Comments
Hi @nedbat, thanks for writing. I agree the current style is a little odd, but for backward compatibility reasons it is here to stay. Your suggestion:
As an addition to the current style is probably doable, I think. |
If we wanted to be truly convenient, then accept a variety of punctuation, etc, and figure it out.
etc. What's the harm in finding the thing the user must have meant? |
@nedbat the main harm in pretending to understand the user is getting it wrong - which is easy for example argparse does it in python by default, and it creates bad bugs in py.test for early parsing of cli args where a plugin registers an option that matches the prefix of a core option while having different semantics if it was an opt-in like --pyargs it would be more easy to work with it/reason about it |
@RonnyPfannschmidt OK, I knew the "dwim" feature idea might be unpopular. Are you ok with the "foo.py:class.method" syntax? |
@nedbat i like that syntax, it may even be a good idea to eventually switch over to it we just have to consider time-frames, and we should figure a consistent way to express parameters with it |
Do you foresee any problems with it @RonnyPfannschmidt? I didn't look too much into it, but I think the first step would be to find all places where there's some handling of the current syntax ( |
@nicoddemus i'm under the impression this one will be one of those hindsight things as well ^^ |
When I want to run a single test, I have to use an odd double-colon syntax:
Double-colons appear nowhere in Python. If the test fails, pytest even reports the failure to me using the usual single-dot syntax:
Please allow the more usual single-dot syntax, and perhaps a single colon between file and class?
Versions:
The text was updated successfully, but these errors were encountered: