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
parses long options with no equals sign incorrectly #7
Comments
This affects an awful lot of useful arguments: --with-profile, --nologcapture, --coverage, --with-id, --failed, --with-xunit, etc etc. |
It's not just long options. Value-less short options like -s are treaded as module names to test:
|
@slinkp What version of django-nose do you have? Your example works for me on master. |
I have django-nose 1.2. I see there's now a 1.3 on pypi, will try that. |
1.3 still has the same problem, and I just tried with django-nose master as of 1d8cb63. Same problem. |
Ah, I have 2.7. Perhaps something changed in optparse in between. |
I am seeing the same issue: Python 2.7.1, Nose 1.0.0, django-nose 0.1.3 Very strange indeed. |
I can replicate the issue as well and is a problem with the option parser, I'm on it. |
It's been a few years, but this is still broken for me. @camilonova, any interest in submitting a PR against current master? |
@jwhitlock Sorry pal, It's been a while, someone else should take care of it. |
@camilonova no problem - thanks for the original code, it's a good start. |
I left this comment on issue 142, but this might be a better place, so duplicating. I started to dive into this, and the fix will be longer than expected, so bumping to v1.4.3. Short version: using Longer version: Command line parsing is complicated:
The problem is that Django likes |
When a long option is used without an equals sign (such as --processes 2 or --verbosity 2), an equals sign is added (--processes=2, --verbosity=2) before passing to nose. This only works in Django 1.8 or later. For Django 1.7 and earlier, --verbosity is handled, but the caller must use --option=value for other parameters. Fixes #7
When a long option is used without an equals sign (such as --processes 2 or --verbosity 2), the argument is passed to nose. This only works in Django 1.8 or later. For Django 1.7 and earlier, --verbosity is handled, but the caller must use --option=value for other parameters. Fixes #7
When a long option is used without an equals sign (such as --processes 2 or --verbosity 2), the argument is passed to nose. This only works in Django 1.8 or later. For Django 1.7 and earlier, --verbosity is handled, but the caller must use --option=value for other parameters. Fixes #7
For Django 1.7 and earlier, hard-code the list of options that include a parameter. Fixes #7
For Django 1.7 and earlier, hard-code the list of options that include a parameter. Fixes #7
I had this same error, somehow removing .noseids fixed it
|
Python's optparse accepts long options also without the equals sign (e.g.
--verbose 2
). Django-nose fails to strip out the values of such Django options when creating the nose command line:To solve this "correctly", some serious hacking with optparse is probably needed. Or, known Django options with arguments could be handled specially.
Or maybe it would be possible to "merge" Django's and nose's option parsers?
The text was updated successfully, but these errors were encountered: