-
Notifications
You must be signed in to change notification settings - Fork 9
Python option +py-doctest changes byexample's default config even for languages other than Python #203
Copy link
Copy link
Closed
Labels
bugout of sync between the code and the docs; something that should be fixed in the near futureout of sync between the code and the docs; something that should be fixed in the near futurenext-majorFor nonbackward compatible changes.For nonbackward compatible changes.
Milestone
Description
Describe the bug
A clear and concise description of what the bug is followed by the steps to reproduce it:
- Create a markdown file
foo.mdwith a single shell example:
$ echo "foo"
<...>- Then I run
byexamplewith python and shell enabled "as usual":
$ byexample -l python,shell foo.md- As expected the
<...>captures theecho "foo"output. Now try with the+py-doctestoption:
$ byexample -l python,shell -o '+py-doctest' foo.mdThis time the test fails.
The problem is that +py-doctest modifies, among other things, the flag tags changing it from True to False. This is ok because for compatibility with Python's doctest the equivalent ellipsis are disabled by default.
Unfortunately this change affects other languages like shell in the example above.
Does make sense to restrict +py-doctest to only Python examples? Certainly it is a surprise the current behavior.
Expected behavior
The tags <...> should be treated as usual and only be treated as literal in Python examples when +py-doctest is enabled.
byexample version
$ byexample -V
byexample 10.3.0 (Python 3.9.7) - GNU GPLv3Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugout of sync between the code and the docs; something that should be fixed in the near futureout of sync between the code and the docs; something that should be fixed in the near futurenext-majorFor nonbackward compatible changes.For nonbackward compatible changes.