Skip to content

fix(tests): handle OS path separators in conftest.py pytest_plugins - #167

Merged
tharropoulos merged 1 commit into
typesense:masterfrom
abhirajadhikary06:fix/conftest-windows-paths
Nov 27, 2026
Merged

tharropoulos merged 1 commit into
typesense:masterfrom
abhirajadhikary06:fix/conftest-windows-paths

Conversation

@abhirajadhikary06

Copy link
Copy Markdown
Contributor

Closes #166

Summary

Fixes pytest failing immediately on Windows when tests/conftest.py builds pytest_plugins module paths.

Changes

  • Update tests/conftest.py to convert fixture file paths into dotted module names using pathlib.Path(fixture_file).with_suffix("").parts instead of .replace("/", ".").replace(".py", "").

Testing

  • Verified on Windows that conftest.pytest_plugins resolves all 21 fixture modules using dotted module paths (tests.fixtures.*).
  • Verified pytest loads tests/conftest.py and imports fixture plugins without the previous No module named 'tests\\fixtures\\alias_fixtures' error.

@abhirajadhikary06

Copy link
Copy Markdown
Contributor Author

@tharropoulos can you review this PR?

@tharropoulos
tharropoulos merged commit 0031098 into typesense:master Nov 27, 2026
4 checks passed
@tharropoulos

Copy link
Copy Markdown
Collaborator

Thank you for the contribution!

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.

Running pytest on Windows crashes in tests/conftest.py due to hardcoded / path separator

3 participants