diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-02-28 18:47:20 +0000 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-02-28 18:47:20 +0000 |
commit | 6d4a4e9928bb718d2da446a7d6a11708301625f2 (patch) | |
tree | c4b25b736e26409a5d3eb3222d54fb1c7e445f0a /tests/testutils/repo/git.py | |
parent | 348f04e7a80338de1b9cc911e48263d8cd31be65 (diff) | |
download | buildstream-bschubert/fix-test-paths.tar.gz |
store full host tools command in sites.py variables check.bschubert/fix-test-paths
This allows tests importing them to have access to the commands
directly and removes the need from calling this multiple times
This also fixes multiple bugs where the paths of the tests runners
might not be canonical and tools would not get found correctly
Diffstat (limited to 'tests/testutils/repo/git.py')
-rw-r--r-- | tests/testutils/repo/git.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py index 3eb8c6577..a12ffaba3 100644 --- a/tests/testutils/repo/git.py +++ b/tests/testutils/repo/git.py @@ -4,7 +4,7 @@ import shutil import subprocess from .repo import Repo -from ..site import HAVE_GIT +from ..site import GIT GIT_ENV = { 'GIT_AUTHOR_DATE': '1320966000 +0200', @@ -19,7 +19,7 @@ GIT_ENV = { class Git(Repo): def __init__(self, directory, subdir): - if not HAVE_GIT: + if not GIT: pytest.skip("git is not available") self.submodules = {} @@ -27,8 +27,8 @@ class Git(Repo): super(Git, self).__init__(directory, subdir) def _run_git(self, *args, **kwargs): - argv = ['git'] - argv.extend(args) + argv = [GIT, *args] + if 'env' not in kwargs: kwargs['env'] = dict(GIT_ENV, PWD=self.repo) kwargs.setdefault('cwd', self.repo) |