diff options
author | Jürg Billeter <j@bitron.ch> | 2019-08-29 21:04:35 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-30 07:30:10 +0200 |
commit | 1c0f161aa48fc39d1f88fa407189b30075c3e1f0 (patch) | |
tree | eee048c724a93e2aefad964739b9f1b97a537287 /tests | |
parent | 8adb55af7871b8e058ad52fe75a4bc2c6fa01d9c (diff) | |
download | buildstream-1c0f161aa48fc39d1f88fa407189b30075c3e1f0.tar.gz |
tests/testutils/repo/bzr.py: Do not ignore environment variables
Merge `os.environ` and `BZR_ENV` instead of replacing the existing
(tox) environment variables such as HOME and XDG_CONFIG_HOME.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testutils/repo/bzr.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/testutils/repo/bzr.py b/tests/testutils/repo/bzr.py index 5b64ba042..7b2392f46 100644 --- a/tests/testutils/repo/bzr.py +++ b/tests/testutils/repo/bzr.py @@ -14,15 +14,18 @@ class Bzr(Repo): super().__init__(directory, subdir) self.bzr = BZR + self.env = os.environ.copy() + self.env.update(BZR_ENV) + def create(self, directory): branch_dir = os.path.join(self.repo, 'trunk') - subprocess.call([self.bzr, 'init-repo', self.repo], env=BZR_ENV) - subprocess.call([self.bzr, 'init', branch_dir], env=BZR_ENV) + subprocess.call([self.bzr, 'init-repo', self.repo], env=self.env) + subprocess.call([self.bzr, 'init', branch_dir], env=self.env) self.copy_directory(directory, branch_dir) - subprocess.call([self.bzr, 'add', '.'], env=BZR_ENV, cwd=branch_dir) + subprocess.call([self.bzr, 'add', '.'], env=self.env, cwd=branch_dir) subprocess.call([self.bzr, 'commit', '--message="Initial commit"'], - env=BZR_ENV, cwd=branch_dir) + env=self.env, cwd=branch_dir) return self.latest_commit() @@ -42,4 +45,4 @@ class Bzr(Repo): self.bzr, 'version-info', '--custom', '--template={revno}', os.path.join(self.repo, 'trunk') - ], env=BZR_ENV, universal_newlines=True).strip() + ], env=self.env, universal_newlines=True).strip() |