summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-31 10:28:31 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 14:33:59 +0000
commit3660337905dada5ee6bd9419ff83b5a6819f6801 (patch)
tree83c1b1d6bad61138a660a6b3a6b501cdbe1c2648 /tests
parent17da93ab01cf538fc855492b621916eb32bbf77d (diff)
downloadbuildstream-3660337905dada5ee6bd9419ff83b5a6819f6801.tar.gz
test:utils/site: Consolidate Bzr environment variables in a single place
We have two different 'site' files that are redundant and both define some variables in BuildStream environment. This is a first step in consolidating them in a single file
Diffstat (limited to 'tests')
-rw-r--r--tests/cachekey/cachekey.py3
-rw-r--r--tests/sources/bzr.py2
-rw-r--r--tests/testutils/repo/bzr.py11
-rw-r--r--tests/testutils/site.py5
4 files changed, 6 insertions, 15 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 2e8c29805..e34c9ff04 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -45,9 +45,10 @@ import os
import pytest
from buildstream.testing.runcli import cli # pylint: disable=unused-import
+from buildstream.testing._utils.site import HAVE_BZR
from buildstream.plugin import CoreWarnings
from buildstream import _yaml
-from tests.testutils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import HAVE_GIT, IS_LINUX, MACHINE_ARCH
##############################################
diff --git a/tests/sources/bzr.py b/tests/sources/bzr.py
index a11932a49..4a66d89b3 100644
--- a/tests/sources/bzr.py
+++ b/tests/sources/bzr.py
@@ -8,7 +8,7 @@ from buildstream import _yaml
from buildstream.testing import cli # pylint: disable=unused-import
from buildstream.testing import create_repo
-from tests.testutils.site import HAVE_BZR
+from buildstream.testing._utils.site import HAVE_BZR
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
diff --git a/tests/testutils/repo/bzr.py b/tests/testutils/repo/bzr.py
index 53bacad17..8b2f17844 100644
--- a/tests/testutils/repo/bzr.py
+++ b/tests/testutils/repo/bzr.py
@@ -3,21 +3,16 @@ import subprocess
import pytest
from buildstream.testing import Repo
-from .. import site
-
-
-BZR_ENV = {
- "BZR_EMAIL": "Testy McTesterson <testy.mctesterson@example.com>"
-}
+from buildstream.testing._utils.site import BZR, BZR_ENV, HAVE_BZR
class Bzr(Repo):
def __init__(self, directory, subdir):
- if not site.HAVE_BZR:
+ if not HAVE_BZR:
pytest.skip("bzr is not available")
super(Bzr, self).__init__(directory, subdir)
- self.bzr = site.BZR
+ self.bzr = BZR
def create(self, directory):
branch_dir = os.path.join(self.repo, 'trunk')
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index ef315efd6..a7ff415e3 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -9,11 +9,6 @@ import platform
from buildstream import _site, utils, ProgramNotFoundError
from buildstream._platform import Platform
-try:
- BZR = utils.get_host_tool('bzr')
- HAVE_BZR = True
-except ProgramNotFoundError:
- HAVE_BZR = False
try:
GIT = utils.get_host_tool('git')