Skip to content

Use source_pkgs in the adhoc layout example - #762

Open
GreedyC wants to merge 1 commit into
pytest-dev:masterfrom
GreedyC:codex/adhoc-source-pkgs
Open

GreedyC wants to merge 1 commit into
pytest-dev:masterfrom
GreedyC:codex/adhoc-source-pkgs

Conversation

@GreedyC

@GreedyC GreedyC commented Sep 25, 2026

Copy link
Copy Markdown

Summary

Update the adhoc-layout example to select the installed example package with coverage.py’s source_pkgs setting. Explain why changedir = tests remains necessary: it makes the test import the installed package instead of the source checkout.

This addresses the configuration/documentation request in #496 without changing pytest-cov runtime behavior.

Verification

  • Installed the example package into a local virtual environment and ran pytest --cov --cov-config=../.coveragerc from examples/adhoc-layout/tests: 1 passed; only example/__init__.py appeared in the coverage table.
  • sphinx-build -b dummy docs /tmp/nkoo-pytest-cov-sphinx passed.
  • git diff --check passed.

The full tox matrix was not run locally; its configured PyPy/Python 3.11 interpreters are not available in this environment.

Copilot AI lite review requested due to automatic review settings September 25, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All reviewed changes are documented and no unresolved issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Updates the adhoc-layout example to use Coverage.py’s source_pkgs configuration and documents why tests run from the tests directory.

Changes:

  • Replaces source with source_pkgs = example.
  • Clarifies installed-package imports and the purpose of changedir = tests.
File Description
examples/​README.rst Documents the updated configuration.
examples/​adhoc-layout/​.coveragerc Targets the installed package via source_pkgs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants