Skip to content
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

Run the doctests with pytest #58

Open
asmeurer opened this issue Jul 17, 2020 · 0 comments
Open

Run the doctests with pytest #58

asmeurer opened this issue Jul 17, 2020 · 0 comments

Comments

@asmeurer
Copy link
Member

Right now the doctests are run with a separate script, ./run_doctests. This is done because we have to patch the doctest runner to get the behavior we want.

It would be nice to get it so that pytest runs the doctests. Possible ways to do this:

  1. Hook into the pytest runner in run_doctests so that the collecter sees them as tests and automatically runs them. I don't know how hard this is to do.
  2. Upstream the improvements to pytest itself. See Add an ini option doctest_standalone_namespace pytest-dev/pytest#6978 and Doctest should ignore lines starting with ``` when run on Markdown files pytest-dev/pytest#7374. This is the preferred option, but the challenge is getting pytest to accept the changes.
  3. Make a custom test that runs run_doctest. The issue here is how to make it show the output nicely, especially when there are failures. I don't know if there is a way to do it, other than to basically do option 1.
@scopatz scopatz added this to the July 2020 milestone Jul 22, 2020
@ericdatakelly ericdatakelly modified the milestones: July 2020, August 2020 Aug 31, 2020
@ericdatakelly ericdatakelly modified the milestones: August 2020, September 2020 Sep 11, 2020
@ericdatakelly ericdatakelly removed this from the September 2020 milestone Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants