-
Notifications
You must be signed in to change notification settings - Fork 51
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
Generaloption: handle option-as-value #185
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4a01bde
Initial attempt at fixing the option-as-value issue
stdweird 80546cd
add extra unit test for option-as-value
boegel 27b3a0e
--amend
boegel c012cf1
add tests to check for 'no such option' errors
boegel 3c37349
correct test where non-existing option is consumed as a value
boegel 94702c8
style fixes
boegel 7e4cb8c
--amend
boegel c9d9860
--amend
boegel 9ce069f
make sure environment options aren't processed multiple times (via _g…
boegel 1210c40
not ... is None <<< is not None
boegel a457921
Rework the code to control via ExtOptionParser constants
stdweird a53ef03
no need for orig_rargs, can use commandline_arguments (this avoids al…
stdweird 850c8e3
bump version to 2.4.1
stdweird dc0d34b
fix @boegel's remarks ;-)
boegel d3c4122
implement support for ALLOW_OPTION_NAME_AS_VALUE + enhance tests
boegel fd57a50
fix broken tests, shortcut for non-string value in is_value_a_command…
boegel 08ca81c
fix remarks
boegel dfafd2f
fix comment
boegel d843c9d
fix moar remarks
boegel e577869
fix MOAR remarks
boegel 1a4093b
Merge pull request #10 from boegel/go_nooptionasvalue
stdweird File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
self.mock_stderr(False)
here to disable the mocking (so we can actually see something if something is broken hard :)maybe the
self.assertErrorRegex
during mocking isn't a good idea either, will we see the actual failed test sincestderr
is being mocked?maybe this is a good place for
try
/except
/finally
instead ofself.assertErrorRegex
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes, and add the
self.assertTrue(msg in stderr)
tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand. isn't the setUp / tearDown supposed to do this? also don't understand the reamkr wrt exceptions and stderr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're mocking stderr, you won't get any output on stderr anymore.
The tearDown will disable the mocking, sure, but it's cleaner to do that in here (since you may be calling this method several times in a single test).