Skip to content

Fix dotted test filenames in importlib mode#14562

Open
marko1olo wants to merge 2 commits into
pytest-dev:mainfrom
marko1olo:fix-dotted-test-module-name
Open

Fix dotted test filenames in importlib mode#14562
marko1olo wants to merge 2 commits into
pytest-dev:mainfrom
marko1olo:fix-dotted-test-module-name

Conversation

@marko1olo
Copy link
Copy Markdown

Closes #14514.

Summary:

  • Sanitizes dotted path components in compute_module_name() so importlib mode derives valid module names for files like foo.test.py.
  • Adds package-resolution and import-path regression coverage for dotted test filenames.
  • Adds the required changelog fragment and AUTHORS entry.

Tests:

  • PYTHONPATH=src python -m pytest testing/test_pathlib.py -q
  • python -m py_compile src\_pytest\pathlib.py testing\test_pathlib.py
  • git diff --check HEAD~1 HEAD

Checklist:

  • Include new tests or update existing tests when applicable.
  • Add text like closes #XYZW to the PR description and/or commits.
  • If AI agents were used, they are credited in Co-authored-by commit trailers.
  • Create a new changelog file in the changelog directory.
  • Add yourself to AUTHORS in alphabetical order.

AI assistance disclosure:

  • OpenAI Codex assisted with this change; the commit includes Co-authored-by: OpenAI Codex <codex@openai.com>.

Co-authored-by: OpenAI Codex <codex@openai.com>
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 6, 2026
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.

Allow dotted test filenames (*.test.py) via one-line change to compute_module_name

1 participant