From ec809a00cafc4149736c8ea1d53d18d4c88cd95b Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Wed, 10 May 2023 13:02:09 -0400 Subject: [PATCH] DOC: Version check is supported in the directive since v0.5 --- README.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.rst b/README.rst index e5e8fe5..ce8aed8 100644 --- a/README.rst +++ b/README.rst @@ -288,6 +288,16 @@ conditionally skipped if a dependency is not available. >>> import asdf >>> asdf.open('file.asdf') +Furthermore, if the code only runs for specific versions of the optional dependency, +you can add a version check like this:: + +.. code-block:: rst + + .. doctest-requires:: asdf<3 + + >>> import asdf + >>> asdf.open('file.asdf') + Finally, it is possible to skip collecting doctests in entire subpackages by using the ``doctest_subpackage_requires`` in the ``[tool:pytest]`` section of the package's ``setup.cfg`` file. The syntax for this option is a list of