-
Notifications
You must be signed in to change notification settings - Fork 372
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
Support for doctest with hy. #1019
Comments
What would it take to adapt doctest to use a Hy repl instead of the Python one? The main reason you put tests in docstrings is to show examples of intended use. If the examples are in a different language it kind of defeats the purpose. You might as well just use normal unit tests. |
The doctest module parses and runs examples, so it'd take re-implementing that.
+1
Not if you are calling your code from Python, not hy. It's still relevant to show Python-based examples. |
This would be really nice to have, so we could automatically check that all our documentation examples are correct as part of running the test suite. But I don't want it badly enough to put in the considerable effort that I suspect will be required. I'm going to leave the issue open in the hope that some kind soul will be interested someday. |
This gist has my investigation in all things hy + doctest: how to do it, limitations, an idea for
hy.contrib.doctest
, and a starting point for a py.test plugin to collect and run .hy doctests in a project.A patch to hy could:
python -m hy.contrib.doctest FILE
to run doctests in a specific module.I can put this together. I'm interested in reactions and/or alternative approaches.
The text was updated successfully, but these errors were encountered: