Skip to content

Pass all environment variables to initdb - closes #1076 #1080

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

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "pypi"
[packages]
pytest = "==8.3.4"
port-for = "==0.7.4"
mirakuru = "==2.5.3"
mirakuru = "==2.6.0"
packaging = "==24.2"
psycopg = "==3.2.4"

Expand Down
4 changes: 4 additions & 0 deletions newsfragments/1076.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Passing all environment variables to the initdb.

This helps the cases where og_ctl is replaced by custom shell script
making additional calls, and needs all the variables, that ie server process gets.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
dependencies = [
"pytest >= 6.2",
"port-for >= 0.7.3",
"mirakuru",
"mirakuru >= 2.6.0",
"packaging",
"psycopg >= 3.0.0"
]
Expand Down
4 changes: 2 additions & 2 deletions pytest_postgresql/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ def init_directory(self) -> None:
password_file.flush()
init_directory += ["-o", " ".join(options)]
# Passing envvars to command to avoid weird MacOs error.
subprocess.check_output(init_directory, env=self._envvars)
subprocess.check_output(init_directory, env=self.envvars)
else:
options += ["--auth=trust"]
init_directory += ["-o", " ".join(options)]
# Passing envvars to command to avoid weird MacOs error.
subprocess.check_output(init_directory, env=self._envvars)
subprocess.check_output(init_directory, env=self.envvars)

self._directory_initialised = True

Expand Down
Loading