-
Notifications
You must be signed in to change notification settings - Fork 44
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
Call to pg_ctl
fails (exception raised) when creating test database
#1051
Comments
Further information: if I run this in the Python REPL it appears to succeed:
|
More info, if I run
|
Based on the above, I commented out the passing of the environment variables to the subprocess:
This results in the data creation step succeeding (I think), but the server is unable to start:
I fixed this by removing the single quotes from And fixing the following error was similar, removing the single quotes from I see now that I am having the same issue as #303 and that my assumption of windows support may have been incorrect. |
Having implemented the fix here: #303 (comment) I now have a working test suite. I had to also add
And I have these changes on lines 183-186 of executor.py:
|
In summary, my issue is that when pytest-postgresql tries to use
pg_ctl
to create the test database, an exception is thrown. I can't see any particular information in the exception that might narrow down the specifics of what is happening.I am pretty new to using postgres so please forgive any stupidity on my part.
System/environment information:
pg_ctl --version
output ispg_ctl (PostgreSQL) 17.0
As far as I can see from various old issues, running on windows should be supported?
Issue Details
I am using the following code to create my application fixture:
When I try to run a test, an exception is thrown at the point where
pg_ctl
is invoked to create the database (line 186 ofexecutor.py
):As far as I can tell there's no useful information captured by the exception.
If I try running this command on the terminal, I get this:
so I commented out line 183 (
options += ["--auth=trust"]
), which resulted the same exception above being raised. If I run that command (i..e without--auth=trust
) in the terminal, it appears to succeed:Given I can run this command from a terminal, maybe there is a permissions issue with running under python/pytest (that's a guess)? Honestly I'm at a loss from here. Any advice would be appreciated.
The text was updated successfully, but these errors were encountered: