From 9a66c223b1124566d00dc76055628d99f2dd0f68 Mon Sep 17 00:00:00 2001 From: ClawOSS Agent Date: Mon, 16 Mar 2026 05:07:21 +0800 Subject: [PATCH] docs(python): document .pxi doctests testing via lib.pyx Add documentation explaining that .pxi file doctests are tested via lib.pyx and that errors surface under lib.pyx rather than the original .pxi filename. Closes apache/arrow#49503 --- docs/source/developers/python/development.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/developers/python/development.rst b/docs/source/developers/python/development.rst index 5757b761875a..ba5e2cace909 100644 --- a/docs/source/developers/python/development.rst +++ b/docs/source/developers/python/development.rst @@ -195,6 +195,16 @@ for ``.py`` files or for ``.pyx`` and ``.pxi`` files. In this case you will also need to install the `pytest-cython `_ plugin. +.. note:: + + When running doctests for ``.pxi`` files, they are actually tested via + ``lib.pyx``. Use the following command pattern:: + + $ python -m pytest --doctest-cython path/to/lib.pyx + + Any doctest errors in ``.pxi`` files will surface under ``lib.pyx`` in + the test output, not under the original ``.pxi`` filename. + Testing Documentation Examples -------------------------------