Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest seems to be failing in certain environments #935

Closed
glass-ships opened this issue Jan 8, 2025 · 1 comment · Fixed by #937 · May be fixed by #890
Closed

Pytest seems to be failing in certain environments #935

glass-ships opened this issue Jan 8, 2025 · 1 comment · Fixed by #937 · May be fixed by #890
Assignees

Comments

@glass-ships
Copy link
Collaborator

I've noticed some CI pipelines for test-backend passing, but locally as well as for other PR's (like #890 and #745) pytest is failing with something along the lines of:

ImportError: Error importing plugin "tests.fixtures.search_query": No module named 'tests'

Appears to be an issue with pytest trying to run/import conftest.py but I can't tell when this issue started or why it's complaining now (pytest version doesn't appear to have changed, and pinning to 8.2.0 doesn't fix the issue)

@kevinschaper
Copy link
Member

I finally recognized this from when it started happening for me locally, I think it's when the PYTHONPATH isn't set to include the root of the python part of the project (./backend). Over in #937 I tweaked the action to include setting PYTHONPATH, and then changed the pytest commands to not look into backend/tests but just direct to tests (I'm a little confused by that, except that it must be a package argument rather than a path argument?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment