Skip to content

Commit 23b00b1

Browse files
committed
tests: set env for run_binary
1 parent 1c860ff commit 23b00b1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/archive.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,9 @@ def test_archive_pg_receivexlog_partial_handling(self):
20302030
if self.archive_compress and node.major_version >= 10:
20312031
cmdline += ['-Z', '1']
20322032

2033-
pg_receivexlog = self.run_binary(cmdline, asynchronous=True)
2033+
env = self.test_env
2034+
env["PGAPPNAME"] = app_name
2035+
pg_receivexlog = self.run_binary(cmdline, asynchronous=True, env)
20342036

20352037
if pg_receivexlog.returncode:
20362038
self.assertFalse(

tests/helpers/ptrack_helpers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,11 @@ def run_pb(self, command, asynchronous=False, gdb=False, old_binary=False, retur
779779
except subprocess.CalledProcessError as e:
780780
raise ProbackupException(e.output.decode('utf-8'), self.cmd)
781781

782-
def run_binary(self, command, asynchronous=False):
782+
def run_binary(self, command, asynchronous=False, env=None):
783+
784+
if not env:
785+
env = self.test_env
786+
783787
if self.verbose:
784788
print([' '.join(map(str, command))])
785789
try:
@@ -789,13 +793,13 @@ def run_binary(self, command, asynchronous=False):
789793
stdin=subprocess.PIPE,
790794
stdout=subprocess.PIPE,
791795
stderr=subprocess.PIPE,
792-
env=self.test_env
796+
env=env
793797
)
794798
else:
795799
self.output = subprocess.check_output(
796800
command,
797801
stderr=subprocess.STDOUT,
798-
env=self.test_env
802+
env=env
799803
).decode('utf-8')
800804
return self.output
801805
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)