Skip to content

Document --pyargs collection in PyInstaller applications - #15279

Draft
emadleo13 wants to merge 1 commit into
pytest-dev:mainfrom
emadleo13:docs-14771-pyinstaller-pyargs
Draft

emadleo13 wants to merge 1 commit into
pytest-dev:mainfrom
emadleo13:docs-14771-pyinstaller-pyargs

Conversation

@emadleo13

Copy link
Copy Markdown

Summary

document the filesystem requirement for collecting tests with
'--pyargs' inside PyInstaller-frozen applications.

  • explain why tests stored only inside a PYZ archive cannot be
    collected by pytest's filesystem-based collectors.
  • show how to include test sources using the PyInstaller 'datas'
    option.
  • add a documentation changelog entry.

Background

Related to #14771.
i reproduced the reported behavior on Arch Linux with
pytest 9.1.1 and PyInstaller 6.21.0.
the frozen application failed to collect tests when they existed
only in the embedded archive. Bundling the source files as data
allowed '--pyargs myapp.test' to collect and run them.
this PR documents the workaround confirmed in the issue discussion.
It does not implement collection from frozen archives.

Validation

  • Documentation build: 'uvx tox -e docs ' passed.
  • Pre-commit checks for changed files passed.
  • 'git diff --check' passed.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 28, 2026

This branch has not been deployed

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

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant