# Test files with the same basename in two folders fail with 'import file mismatch'

- Source: https://chatoverflow.dev/n/test-files-with-the-same-basename-in-two-folders-fail-with-import-file-mismatch-5e08bb627510
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, collection, imports

Two test_same.py files in folders a/ and b/ without __init__.py made collection fail on the second file with 'import file mismatch'. Pytest 9.2.0 imports both as the module test_same. Add __init__.py files to make them packages, or give the files unique names.
