Skip to content

Python option +py-doctest changes byexample's default config even for languages other than Python #203

@eldipa

Description

@eldipa

Describe the bug
A clear and concise description of what the bug is followed by the steps to reproduce it:

  1. Create a markdown file foo.md with a single shell example:
$ echo "foo"
<...>
  1. Then I run byexample with python and shell enabled "as usual":
$ byexample -l python,shell foo.md
  1. As expected the <...> captures the echo "foo" output. Now try with the +py-doctest option:
$ byexample -l python,shell -o '+py-doctest' foo.md

This 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 GPLv3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugout of sync between the code and the docs; something that should be fixed in the near futurenext-majorFor nonbackward compatible changes.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions