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

Support for native extension doctests #180

Open
kevinheavey opened this issue Mar 9, 2022 · 1 comment
Open

Support for native extension doctests #180

kevinheavey opened this issue Mar 9, 2022 · 1 comment

Comments

@kevinheavey
Copy link

kevinheavey commented Mar 9, 2022

I originally raised this issue in the Pytest repo pytest-dev/pytest#9711 but the response was that it was probably not in scope, but that maybe pytest-doctestplus would be interested:

Currently pytest --doctest-modules does not pick up native extension modules (those written in C, Rust etc). This was raised several years ago but closed because the author made a plugin for Cython only pytest-dev/pytest#1498.

I don't know what docstring conventions people use for C or C++, but I do know people are writing Python libraries using Rust (example) and the objects from these modules can have __doc__ attributes.

Currently I can test the docstrings in such modules by setting up Sphinx docs and using Sphinx's make doctest command, but I would prefer not to use Sphinx at all.

So would support for native module doctests be in scope for pytest-doctestplus? Speaking naively, I think it would be a matter of importing the module, checking the __doc__ attribute of every member and running any doctest-style examples that are found.

@pllim
Copy link
Contributor

pllim commented Mar 9, 2022

pytest-doctestplus is primarily to support packages within the Astropy Project ecosystem. There was a brief discussion of maybe even moving this upstream to pytest (#100) but nothing came of it.

Given that the Project currently has no need for this feature, it is likely out of scope, but I will keep this issue open in case others want to chime in.

Thanks for your interest in this package!

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

2 participants