-
Notifications
You must be signed in to change notification settings - Fork 12
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
Tests embeddeded in Markdown #145
Comments
Markdown (and RST) file support is currently not implemented. The place to add this would be in xdoctest/core.py in A CallDefNode is fairly easy to construct. The line numbers aren't necessary for anything except reporting and can be spoofed for quick tests. The main thing to get right is that I'd be happy to merge a PR for this feature. |
Note, looking at old issues, this is related to #49 and it looks like you can work around the issue by using pytest. E.g.
Then: But this just parses the files as text and not markdown. Looking at the |
There may not be any! For full backwards compatibility with That file can be tested with $ cd ..../pysyte
$ python -m doctest pysyte/types/test/paths.test Or can be included in $ cd .../pysyte
$ pytest --doctest-glob=*.test pysyte I'm a big fan of doctests, and was considering switching hence. But I've hundreds of tests in |
@jalanb You can use xdoctest on text files with pytest. Install xdoctest and then change your invocation to: pytest --xdoctest-glob=*.test pysyte It's just the native runner that doesn't currently handle them, but it shouldn't be that hard to add support for it. As previously mentioned you could modify |
Per this stack-overflow and my own experiments, doctest actually works with tests embedded in README.md. I can't figure out how to get xdoctest to do this.
This is a bug if the goal for xdoctest is to be completely compatible with classic doctest. Also, I do understand that markdown is an edge-case and generally working with modules is more useful. Still.. markdown support is extremely convenient for small projects
The text was updated successfully, but these errors were encountered: