Skip to content

Commit ecff1a1

Browse files
committed
GH-49503: [Python][Doc] Document that .pxi doctests are tested via lib.pyx
1 parent a315b96 commit ecff1a1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎docs/source/developers/python/development.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ for ``.py`` files or
195195
for ``.pyx`` and ``.pxi`` files. In this case you will also need to
196196
install the `pytest-cython <https://github.com/lgpage/pytest-cython>`_ plugin.
197197

198+
.. note::
199+
Cython ``.pxi`` files are included in ``.pyx`` files at compile time,
200+
so ``--doctest-cython`` cannot be run directly on ``.pxi`` files.
201+
Instead, run doctests on the ``.pyx`` file they are included in, for
202+
example ``lib.pyx``::
203+
204+
$ python -m pytest --doctest-cython pyarrow/lib.pyx
205+
206+
Any doctest errors originating from ``.pxi`` files will appear under
207+
the corresponding ``.pyx`` file, not the original ``.pxi`` filename.
208+
198209
Testing Documentation Examples
199210
-------------------------------
200211

0 commit comments

Comments
 (0)