Skip to content

Conversation

@LilyFirefly
Copy link
Collaborator

Some local development environments were failing to connect to postgres with this error:

django.db.utils.OperationalError: connection failed:
    connection to server at "127.0.0.1", port 5432 failed:
    fe_sendauth: no password supplied

At first, this error was hidden by this warning (which we turn into an error):

RuntimeWarning:
    Normally Django will use a connection to the 'postgres' database
    to avoid running initialization queries against the production
    database when it's not needed (for example, when running tests).
    Django was unable to create a connection to the 'postgres'
    database and will use the first PostgreSQL database instead.

By not defining the host as localhost in the test settings, tests run correctly.


Add coverage generated files to .gitignore to prevent accidentally committing them.

@LilyFirefly LilyFirefly self-assigned this Jan 20, 2026
@LilyFirefly LilyFirefly requested a review from a team as a code owner January 20, 2026 15:15
LilyFirefly and others added 3 commits January 20, 2026 15:23
Some local development environments were failing to connect to postgres
with this error:

    django.db.utils.OperationalError: connection failed:
	connection to server at "127.0.0.1", port 5432 failed:
	fe_sendauth: no password supplied

At first, this error was hidden by this warning (which we turn into an
error):

    RuntimeWarning:
	Normally Django will use a connection to the 'postgres' database
	to avoid running initialization queries against the production
	database when it's not needed (for example, when running tests).
	Django was unable to create a connection to the 'postgres'
	database and will use the first PostgreSQL database instead.

By not defining the host as `localhost` in the test settings, tests run
correctly.

Co-authored-by: Charlie Denton <[email protected]>
@LilyFirefly LilyFirefly force-pushed the fix-test-dbs-and-gitignore branch from 4ef8b60 to 90b1cdf Compare January 20, 2026 15:24
@meshy meshy merged commit 681e781 into main Jan 21, 2026
7 checks passed
@meshy meshy deleted the fix-test-dbs-and-gitignore branch January 21, 2026 10:30
@meshy
Copy link
Collaborator

meshy commented Jan 21, 2026

Thanks!

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.

3 participants