From 3b56da44bdafeff1237391ad9edbb73010bcd5ee Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Fri, 31 May 2019 17:00:47 +0100 Subject: test:utils/site: Consolidate arpy environment variables in a single place We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the arpy related ones in a single place. --- src/buildstream/testing/_utils/site.py | 6 ++++++ tests/sources/deb.py | 2 +- tests/testutils/site.py | 6 ------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py index 306f41c9f..9d18d89bd 100644 --- a/src/buildstream/testing/_utils/site.py +++ b/src/buildstream/testing/_utils/site.py @@ -55,6 +55,12 @@ try: except ProgramNotFoundError: HAVE_LZIP = False +try: + import arpy # pylint: disable=unused-import + HAVE_ARPY = True +except ImportError: + HAVE_ARPY = False + IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux') IS_WSL = (IS_LINUX and 'Microsoft' in platform.uname().release) IS_WINDOWS = (os.name == 'nt') diff --git a/tests/sources/deb.py b/tests/sources/deb.py index 69b7c78df..bdde20aaa 100644 --- a/tests/sources/deb.py +++ b/tests/sources/deb.py @@ -9,7 +9,7 @@ import pytest from buildstream._exceptions import ErrorDomain from buildstream import _yaml from buildstream.testing import cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_ARPY +from buildstream.testing._utils.site import HAVE_ARPY from . import list_dir_contents DATA_DIR = os.path.join( diff --git a/tests/testutils/site.py b/tests/testutils/site.py index 3fcf7e150..b72be1e33 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -22,12 +22,6 @@ try: except (ImportError, ValueError): HAVE_OSTREE = False -try: - import arpy # pylint: disable=unused-import - HAVE_ARPY = True -except ImportError: - HAVE_ARPY = False - IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux') IS_WSL = (IS_LINUX and 'Microsoft' in platform.uname().release) IS_WINDOWS = (os.name == 'nt') -- cgit v1.2.1