Conversation
Previous this commit each ExampleParser returned a default options and the options parsed from the command line and byexample/init put those in the main Options object making them active for all the rest of byexample regardless of the examples' language. This allowed one parser to change the default values for an option and affect other parser/example of other language. PythonParser was a case of this: when +py-doctest was enabled, the +tags was disabled which makes sense for Python's Doctest but clearly breaks any other language as +tags is expected to be enabled by default, not disabled. So the Python-specific option +py-doctest was indeed affecting non-Python examples. The isolation implemented makes byexample/init to store each ExampleParser's defaults and options from command line in a separated dictionary and indexed them by language. This language_specific_defaults is available via the Options as another entry and not as another options layer (they are not active) FileExecutor is then now responsible of "activating" the lang-specific defaults, putting them on top of the Options before executing ExampleRunner's code or parsing/running an example. The change should be transparent to ExampleParser and ExampleRunner but it may be noticed by any ZoneDelimiter, ExampleFinder and in particular to any Concern however it is belived that no real use-case exists for requiring a Concern to have access to lang-specific options.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #203