Skip to content

Conversation

@fumedev
Copy link

@fumedev fumedev bot commented Mar 24, 2024

FIXED

  • Modified the import_path function in src/_pytest/pathlib.py to handle the existence of conftest.py files correctly when importing modules in importlib mode. This adjustment ensures that the sys.path manipulation by pytest combined with pythonpath and --import-mode=importlib does not cause tests.<subpackages> to not be found.

ADDED

  • Added a new test case in testing/test_config.py to cover the reported regression. The test, test_import_mode_importlib_with_conftest_and_pythonpath, verifies the correct import of tests.subpath.helper when using importlib mode with conftest.py and pythonpath present.

VALIDATED

  • Validated the fix by running the new test case, ensuring it passes, and confirming that no new regressions are introduced. Also, ran the full pytest test suite to verify that all existing tests pass without any issues.

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.

1 participant