Merge lp:~vila/django-configglue/be-verbose into lp:django-configglue
Status: | Merged |
---|---|
Approved by: | Ricardo Kirkner |
Approved revision: | 73 |
Merged at revision: | 69 |
Proposed branch: | lp:~vila/django-configglue/be-verbose |
Merge into: | lp:django-configglue |
Diff against target: |
133 lines (+26/-60) 3 files modified
django_configglue/management/__init__.py (+13/-49) django_configglue/tests/test_configglue.py (+12/-10) django_configglue/tests/test_settings.py (+1/-1) |
To merge this branch: | bzr merge lp:~vila/django-configglue/be-verbose |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ricardo Kirkner | Approve | ||
Review via email: mp+129439@code.launchpad.net |
Commit message
Don't swallow standard django options like --verbosity.
Description of the change
In one project I'm working on which uses django_configglue, I came across
something weird, when running:
django_
no matter which value I set X to, the output was the same.
Digging further, it happened that django_configglue was swallowing
--verbosity and the test command always received verbosity=1 (the default).
This patch fixes the issue by overriding GlueManagementU
a narrower way.
I added a failing test prior to the fix and had to fix one other test as a
fallout (it's nice to have a test suite here that precisely caught them ;).
I tweaked another in test_settings for better output when it failed because
I had left the 'version=
LaxOptionParser (another nice catch of the test suite).
Now I can enjoy more verbosity when running my tests and I hope you will too ;)
l. 14: I'd use something like 'Override the base class to handle schema-related options.'
l. 24: is this really necessary? can't we just omit the param?
l. 65: depending on the branch taken by l. 25-34 either configglue_parser or parser is not defined
l. 64-68: this should only be invoked if configglue_parser is defined
given the simplified approach, maybe we can completely ditch the custom parser defined here (we're not really adding any value with it -- schemaconfigglue will create an empty parse if op is None -- or not passed in).
l. 84: no need to use a tuple for this case, but it's ok module. path') syntax to avoid having to import the module here
l. 95-96: I'd use the standard patch('
l. 101-107: as discussed on irc, with the simplified version, this test make no sense anymore (as all code paths will end up in a SystemExit, disregarding whether an exception was raised or not).
l. 117: we prefer singulars (assertEqual, not assertEquals)