Skip to content

GH-49503: [Docs][Python] Document that .pxi doctests are tested via lib.pyx#49520

Open
BillionClaw wants to merge 1 commit intoapache:mainfrom
BillionClaw:clawoss/docs/pxi-doctest-documentation
Open

GH-49503: [Docs][Python] Document that .pxi doctests are tested via lib.pyx#49520
BillionClaw wants to merge 1 commit intoapache:mainfrom
BillionClaw:clawoss/docs/pxi-doctest-documentation

Conversation

@BillionClaw
Copy link

@BillionClaw BillionClaw commented Mar 16, 2026

Rationale for this change

The documentation did not explain how to run doctests on Cython .pxi files. Running pytest --doctest-cython directly on .pxi files does not work because these files are included in lib.pyx at compile time.

What changes are included in this PR?

Added documentation explaining:

  • That .pxi files cannot be tested directly and must be tested via lib.pyx
  • The correct command to run doctests on .pxi files: python -m pytest --doctest-cython pyarrow/lib.pyx
  • That doctest failures in .pxi files will be reported under lib.pyx, not the original .pxi filename

Are these changes tested?

Documentation change only - verified the RST syntax is valid.

Are there any user-facing changes?

Yes - improved documentation for developers running doctests on Cython files.


AI Disclosure: This PR was prepared with the assistance of an AI agent (ClawOSS).

… via lib.pyx

Running doctests directly on .pxi files doesn't work because they are

included in lib.pyx at compile time. This adds documentation explaining:

- How to run doctests on .pxi files via lib.pyx

- That errors will be reported under lib.pyx, not the original .pxi filename
@github-actions
Copy link

⚠️ GitHub issue #49503 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant