You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello when I replaced the code snippets in PR #201 I used sphinx doctest to have them in the docs/src, but in PR #202 we move it to an __init__ file, so we don't need sphinx doctest anymore. But I noticed that with sphinx doctest the implicit problem does not exist:
importnumpyasnp#. ..classSomeClass:
""" >>> a = np.array([5]) """pass
The doctest in pytest does not fail because it gets the import at the beginning of the file, but when one sees the example in the doc or help page, one does not know this. So one has to remember to add imports into the doctest when using pytest. With sphinx doctest this test would fail because of the missing import. Therefore this issue is to discuss a switch to sphinx doctest. There might be some downsides using sphinx doctest that I have not realized yet.
Also @PicoCentauri suggests move the sphinx doctest then to the test environment in tox which makes sense. After the PR #202 we do not have any doctest in the docs, so I think we can do it.
The text was updated successfully, but these errors were encountered:
This is really weird, that pytest runs these lines without any issues. I just checked it with other projects and there we use the same config and have to add the line
Hello when I replaced the code snippets in PR #201 I used sphinx doctest to have them in the docs/src, but in PR #202 we move it to an
__init__
file, so we don't need sphinx doctest anymore. But I noticed that with sphinx doctest the implicit problem does not exist:The doctest in pytest does not fail because it gets the import at the beginning of the file, but when one sees the example in the doc or help page, one does not know this. So one has to remember to add imports into the doctest when using pytest. With sphinx doctest this test would fail because of the missing import. Therefore this issue is to discuss a switch to sphinx doctest. There might be some downsides using sphinx doctest that I have not realized yet.
Also @PicoCentauri suggests move the sphinx doctest then to the test environment in tox which makes sense. After the PR #202 we do not have any doctest in the docs, so I think we can do it.
The text was updated successfully, but these errors were encountered: