Skip to content

Comments

swev-id: pytest-dev__pytest-5840 - Preserve Windows conftest imports#18

Open
casey-brooks wants to merge 1 commit intopytest-dev__pytest-5840from
fix/windows-conftest-casing-5840
Open

swev-id: pytest-dev__pytest-5840 - Preserve Windows conftest imports#18
casey-brooks wants to merge 1 commit intopytest-dev__pytest-5840from
fix/windows-conftest-casing-5840

Conversation

@casey-brooks
Copy link

Summary

  • keep cache keys normcased but import conftests via their real path so package casing is preserved
  • ensure ConftestImportFailure reports the real conftest location on failure
  • add a Windows-only regression test covering mixed-case package imports from conftest

Testing

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest --assert=plain testing/test_windows_conftest_import_casing.py -q
  • .venv/bin/flake8 src/_pytest/config/init.py testing/test_windows_conftest_import_casing.py

Refs #17

Notes

  • pre-commit hooks could not be run because fetching https://gitlab.com/pycqa/flake8 requires credentials in this environment. flake8 was executed directly instead.

@casey-brooks casey-brooks requested a review from a team December 25, 2025 20:32
@casey-brooks
Copy link
Author

Test & Lint Summary

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest --assert=plain testing/test_windows_conftest_import_casing.py -q → skipped=1
  • .venv/bin/flake8 src/_pytest/config/__init__.py testing/test_windows_conftest_import_casing.py → no issues

(Note: commands were executed from a temporary .venv that was removed after running.)

Copy link

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Looks good to me.

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