You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: clarify .env requirement for running tests locally
Update documentation to explicitly state that a valid .env file is
required to run tests locally. This was always needed for database
access, but is now also enforced by credential validators.
-`TEST_DB_NAME` - Your test database name (defaults to `api-template-test`, **recommended to set explicitly**)
210
+
211
+
Tests will use the same database credentials (DB_USER/DB_PASSWORD) but connect to the TEST_DB_NAME database instead.
212
+
213
+
See the [Configuration](https://fastapi-template.seapagan.net/usage/configuration/setup/) section in the documentation for full setup instructions, or copy `.env.example` to `.env` and update the values.
214
+
215
+
Tests require these credentials to pass validation checks and connect to your local PostgreSQL database. **Tests will fail without a properly configured `.env` file.**
- `TEST_DB_NAME` - Your test database name (defaults to `api-template-test`, **recommended to set explicitly**)
60
62
61
-
Tests run on GitHub Actions will ignore these settings and use their own
62
-
hosted Postregsql test database.
63
+
Tests will use the same database credentials (DB_USER/DB_PASSWORD) but connect to the TEST_DB_NAME database instead. **Do not use a production database for testing** as the test database will be cleared before each test run.
64
+
65
+
Copy `.env.example` to `.env` and update with your local values. See the [Configuration](/usage/configuration/setup/) section for full setup instructions.
66
+
67
+
Tests run on GitHub Actions use environment variables set in the CI workflow and a hosted PostgreSQL test database.
63
68
64
69
To run these from within the virtual environment use the `pytest` command:
0 commit comments