Try

sphinx-build -b doctest docs path/to/output -D exclude_patterns=src

(not tested, just an idea)

--
Matt
https://techwriter.documatt.com

> On 6. 2. 2022, at 17:14, Matthew Giammar <mdgiam...@gmail.com> wrote:
> 
> I have a python library which uses Sphinx to build documentation pages. The 
> library structure is as follows:
> 
> Library-name
> |- /docs
> |  |- <lots of .rst files>
> |  |- config.py
> |
> |- /src
> |  |- <python files>
> |
> |- conftest.py
> Some pages defined by .rst files have static Python code which should be 
> tested and we recently converted the code-block directives to testcode 
> directives. Running make doctest successfully tests the code in .rst files, 
> but it also finds Python files under /src and tests the example code in 
> docstrings. The docstring code is already covered by pytest and many of the 
> examples fail with doctest since there are differences in test setup.
> 
> I've already tried setting doctest_global_setup in /docs/config.pyto the code 
> in conftest.py, but tests are still failing.
> 
> Is there a way to ignore certain directories when running make doctestso 
> files in the source folder are ignored?
> 
> 
> 
> --
> 
> Matthew
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sphinx-users/16ecf135-ad47-4869-b85f-a5836a4df378n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/91698324-DC47-4911-8EC4-C0D769B5C3A5%40documatt.com.

Reply via email to