-
Notifications
You must be signed in to change notification settings - Fork 46
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 issues #44
Comments
Hey @jmwebb... I've kind-of left the tests stranded since refreshing this stack, so thanks for looking at this. I vaguely remember a similar issue on the main stack when I first started working on this. First question ... some of these weirder glitches on the |
Right, I've just run a full new build from In
But that fails. I'm not sure what either of the
Which is not surprising, because the Is this an error from this base stack, or is yours already your custom development? |
Been having a ton of trouble running the
scripts/test-local.sh
as instructed in theREADME
. I keep running intoModulenotFoundError
issues inbackend/app/app/tests/conftest.py
I've confirmed the following are working:backend/app
to/app
as expected./app
is getting set as the Python path as expected.bash
'd into the backend container.sys.path
contains/app
as expected (I print it out while runningpytest -s
).However, no matter how I seem to run
pytest
(bash
'd into the backend service,docker compose run backend pytest
, or thetest-local.sh
script), I get the following error:When I try to append an extra
app.
to the imports (e.g.,from app.app.core.config import settings
, the error goes away, but then my regular backend service crashes (ModuleNotFoundErrorapp.app
). Clearly it is some difference between how pytest and running the service regularly handle imports.My file structure is the same as the template project: the
main.py
for FastAPI lives atbackend/app/app
, mypyproject.toml
lives atbackend/app
.I am running
pytest 7.1.3
,python 3.10
, and Mac OS 14.1.The text was updated successfully, but these errors were encountered: