Skip to content

Commit 64154f4

Browse files
author
BillionClaw
committed
docs(python): Document that .pxi doctests are tested via lib.pyx
Adds documentation clarifying that .pxi file doctests are tested via lib.pyx since .pxi files are included in lib.pyx and are not standalone modules. Fixes apache#49503
1 parent d6ce56e commit 64154f4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ 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 that ``.pxi`` files (such as ``array.pxi``) are included in ``lib.pyx``
199+
and doctests in ``.pxi`` files are tested via ``lib.pyx``. This means that
200+
to run doctests for ``.pxi`` files, you should run the doctests on
201+
``lib.pyx`` instead of on individual ``.pxi`` files:
202+
203+
.. code-block::
204+
205+
$ python -m pytest --doctest-cython pyarrow/lib.pyx
206+
207+
or to test a specific ``.pxi`` file, you can run all doctests on ``lib.pyx``
208+
and the doctests from the included ``.pxi`` files will be tested as well.
209+
198210
Testing Documentation Examples
199211
-------------------------------
200212

0 commit comments

Comments
 (0)