diff options
Diffstat (limited to 'tests')
140 files changed, 278 insertions, 230 deletions
diff --git a/tests/artifactcache/artifactservice.py b/tests/artifactcache/artifactservice.py index c640665a3..7da7bd8df 100644 --- a/tests/artifactcache/artifactservice.py +++ b/tests/artifactcache/artifactservice.py @@ -22,10 +22,10 @@ from urllib.parse import urlparse import grpc import pytest +from buildstream import utils +from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 as re_pb2 from buildstream._protos.buildstream.v2.artifact_pb2 import Artifact, GetArtifactRequest, UpdateArtifactRequest from buildstream._protos.buildstream.v2.artifact_pb2_grpc import ArtifactServiceStub -from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 as re_pb2 -from buildstream import utils from tests.testutils.artifactshare import create_artifact_share diff --git a/tests/artifactcache/capabilities.py b/tests/artifactcache/capabilities.py index c8a49f9b5..be3541a44 100644 --- a/tests/artifactcache/capabilities.py +++ b/tests/artifactcache/capabilities.py @@ -4,15 +4,14 @@ import os import pytest -from buildstream._project import Project from buildstream import _yaml +from buildstream._project import Project from buildstream.testing.runcli import cli # pylint: disable=unused-import -from tests.testutils import dummy_context +from tests.testutils import dummy_context from tests.testutils.artifactshare import create_dummy_artifact_share - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/artifactcache/config.py b/tests/artifactcache/config.py index 24d555860..57e167a6a 100644 --- a/tests/artifactcache/config.py +++ b/tests/artifactcache/config.py @@ -6,18 +6,16 @@ import os import pytest -from buildstream._remote import RemoteSpec, RemoteType +from buildstream import _yaml from buildstream._artifactcache import ArtifactCache from buildstream._project import Project -from buildstream.utils import _deduplicate -from buildstream import _yaml +from buildstream._remote import RemoteSpec, RemoteType from buildstream.exceptions import ErrorDomain, LoadErrorReason - from buildstream.testing.runcli import cli # pylint: disable=unused-import +from buildstream.utils import _deduplicate from tests.testutils import dummy_context - DATA_DIR = os.path.dirname(os.path.realpath(__file__)) cache1 = RemoteSpec(url="https://example.com/cache1", push=True) cache2 = RemoteSpec(url="https://example.com/cache2", push=False) diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py index f2be797c3..d33f367e4 100644 --- a/tests/artifactcache/expiry.py +++ b/tests/artifactcache/expiry.py @@ -31,7 +31,6 @@ from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import create_element_size, wait_for_cache_granularity - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "expiry") diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index df7ee9473..14a700b89 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -3,13 +3,13 @@ import os import shutil + import pytest from buildstream import _yaml from buildstream.testing import cli # pylint: disable=unused-import -from tests.testutils import create_artifact_share, assert_shared, assert_not_shared - +from tests.testutils import assert_not_shared, assert_shared, create_artifact_share DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "junctions",) diff --git a/tests/artifactcache/pull.py b/tests/artifactcache/pull.py index e6eaec960..86172570c 100644 --- a/tests/artifactcache/pull.py +++ b/tests/artifactcache/pull.py @@ -12,7 +12,6 @@ from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import create_artifact_share, dummy_context - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py index 7160e05b4..76287661e 100644 --- a/tests/artifactcache/push.py +++ b/tests/artifactcache/push.py @@ -5,14 +5,13 @@ import os import pytest -from buildstream import _yaml, Scope +from buildstream import Scope, _yaml from buildstream._project import Project from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import create_artifact_share, create_split_share, dummy_context - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py index 951972206..84f1dcc5e 100644 --- a/tests/cachekey/cachekey.py +++ b/tests/cachekey/cachekey.py @@ -39,17 +39,16 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -from collections import OrderedDict import os +from collections import OrderedDict import pytest -from buildstream.testing._cachekeys import check_cache_key_stability, _parse_output_keys -from buildstream.testing.runcli import cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH -from buildstream.plugin import CoreWarnings from buildstream import _yaml - +from buildstream.plugin import CoreWarnings +from buildstream.testing._cachekeys import _parse_output_keys, check_cache_key_stability +from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH +from buildstream.testing.runcli import cli # pylint: disable=unused-import # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/conftest.py b/tests/conftest.py index bb4611a11..14c5d0d9e 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,13 +28,11 @@ from buildstream.testing import register_repo_kind, sourcetests_collection_hook from buildstream.testing._fixtures import reset_global_node_state, thread_check # pylint: disable=unused-import from buildstream.testing.integration import integration_cache # pylint: disable=unused-import - -from tests.testutils.repo.git import Git from tests.testutils.repo.bzr import Bzr +from tests.testutils.repo.git import Git from tests.testutils.repo.tar import Tar from tests.testutils.repo.zip import Zip - # # This file is loaded by pytest, we use it to add a custom # `--integration` option to our test suite, and to install diff --git a/tests/elements/filter.py b/tests/elements/filter.py index 3bc24c20a..ee0d72603 100644 --- a/tests/elements/filter.py +++ b/tests/elements/filter.py @@ -6,10 +6,10 @@ import shutil import pytest -from buildstream.testing import create_repo -from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.exceptions import ErrorDomain from buildstream import _yaml +from buildstream.exceptions import ErrorDomain +from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import create_repo DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "filter",) diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py index c2cd0548b..9dcb6e218 100644 --- a/tests/examples/autotools.py +++ b/tests/examples/autotools.py @@ -2,11 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX, IS_LINUX, MACHINE_ARCH from buildstream.testing.integration import assert_contains -from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH, HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/examples/developing.py b/tests/examples/developing.py index 90d33bff1..5c69dbe78 100644 --- a/tests/examples/developing.py +++ b/tests/examples/developing.py @@ -2,11 +2,13 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX, IS_LINUX, MACHINE_ARCH from buildstream.testing.integration import assert_contains -from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH, HAVE_SANDBOX + import tests.testutils.patch as patch pytestmark = pytest.mark.integration diff --git a/tests/examples/first-project.py b/tests/examples/first-project.py index 8783c4ae3..259f01915 100644 --- a/tests/examples/first-project.py +++ b/tests/examples/first-project.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing.integration import assert_contains from buildstream.testing._utils.site import IS_LINUX - +from buildstream.testing.integration import assert_contains pytestmark = pytest.mark.integration diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py index d20c7e136..29a8bb7e9 100644 --- a/tests/examples/flatpak-autotools.py +++ b/tests/examples/flatpak-autotools.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing.integration import assert_contains from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH - +from buildstream.testing.integration import assert_contains pytestmark = pytest.mark.integration diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py index ad270d077..7e3bd7a9f 100644 --- a/tests/examples/integration-commands.py +++ b/tests/examples/integration-commands.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH, HAVE_SANDBOX - +from buildstream.testing._utils.site import HAVE_SANDBOX, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration DATA_DIR = os.path.join( diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py index 1bfc9cdaa..3fc574923 100644 --- a/tests/examples/junctions.py +++ b/tests/examples/junctions.py @@ -2,10 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH, HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py index 9f60b7237..9929d3217 100644 --- a/tests/examples/running-commands.py +++ b/tests/examples/running-commands.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH, HAVE_SANDBOX - +from buildstream.testing._utils.site import HAVE_SANDBOX, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "doc", "examples", "running-commands") diff --git a/tests/format/assertion.py b/tests/format/assertion.py index 3ca50726c..44330b883 100644 --- a/tests/format/assertion.py +++ b/tests/format/assertion.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/dependencies.py b/tests/format/dependencies.py index b1a684081..ada120b2a 100644 --- a/tests/format/dependencies.py +++ b/tests/format/dependencies.py @@ -2,6 +2,7 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain, LoadErrorReason diff --git a/tests/format/include.py b/tests/format/include.py index d57dd8c19..f78ee8376 100644 --- a/tests/format/include.py +++ b/tests/format/include.py @@ -3,13 +3,15 @@ import os import textwrap + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo -from tests.testutils import generate_junction +from tests.testutils import generate_junction # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "include") diff --git a/tests/format/include_composition.py b/tests/format/include_composition.py index 3224822af..d87d80735 100644 --- a/tests/format/include_composition.py +++ b/tests/format/include_composition.py @@ -1,10 +1,9 @@ import os - from contextlib import contextmanager -from buildstream._project import Project -from buildstream._includes import Includes from buildstream import _yaml +from buildstream._includes import Includes +from buildstream._project import Project from tests.testutils import dummy_context diff --git a/tests/format/invalid_keys.py b/tests/format/invalid_keys.py index b2bab194e..cc12c08e3 100644 --- a/tests/format/invalid_keys.py +++ b/tests/format/invalid_keys.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/junctions.py b/tests/format/junctions.py index f5858f7e2..099c7aab7 100644 --- a/tests/format/junctions.py +++ b/tests/format/junctions.py @@ -10,7 +10,6 @@ from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "junctions",) diff --git a/tests/format/link.py b/tests/format/link.py index e2c9e0b84..2be5861d6 100644 --- a/tests/format/link.py +++ b/tests/format/link.py @@ -5,9 +5,8 @@ import os import pytest -from buildstream.testing import cli # pylint: disable=unused-import from buildstream.exceptions import ErrorDomain, LoadErrorReason - +from buildstream.testing import cli # pylint: disable=unused-import DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "link",) diff --git a/tests/format/listdirectiveerrors.py b/tests/format/listdirectiveerrors.py index 77d9b3f55..9e4fdae88 100644 --- a/tests/format/listdirectiveerrors.py +++ b/tests/format/listdirectiveerrors.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/option-list-directive.py b/tests/format/option-list-directive.py index 2df5b6f77..313741af0 100644 --- a/tests/format/option-list-directive.py +++ b/tests/format/option-list-directive.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.testing.runcli import cli # pylint: disable=unused-import # Project directory diff --git a/tests/format/optionbool.py b/tests/format/optionbool.py index 6f5624926..75e2ebd5c 100644 --- a/tests/format/optionbool.py +++ b/tests/format/optionbool.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/optioneltmask.py b/tests/format/optioneltmask.py index c5b32d127..52deebe67 100644 --- a/tests/format/optioneltmask.py +++ b/tests/format/optioneltmask.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/optionenum.py b/tests/format/optionenum.py index b525347f8..5dc336e95 100644 --- a/tests/format/optionenum.py +++ b/tests/format/optionenum.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/optionexports.py b/tests/format/optionexports.py index 4f95dc109..8731b90b8 100644 --- a/tests/format/optionexports.py +++ b/tests/format/optionexports.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/optionflags.py b/tests/format/optionflags.py index a3c310f05..9f87572ed 100644 --- a/tests/format/optionflags.py +++ b/tests/format/optionflags.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/optionoverrides.py b/tests/format/optionoverrides.py index ba12e751f..dc9990889 100644 --- a/tests/format/optionoverrides.py +++ b/tests/format/optionoverrides.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/options.py b/tests/format/options.py index 4af3495b4..8920da8eb 100644 --- a/tests/format/options.py +++ b/tests/format/options.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/project.py b/tests/format/project.py index d3de67222..83063a3c0 100644 --- a/tests/format/project.py +++ b/tests/format/project.py @@ -2,14 +2,15 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import filetypegenerator - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") diff --git a/tests/format/projectoverrides.py b/tests/format/projectoverrides.py index 16aad2cf8..d25725c7d 100644 --- a/tests/format/projectoverrides.py +++ b/tests/format/projectoverrides.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream import _yaml from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/format/substitutions.py b/tests/format/substitutions.py index 265f13e66..026619547 100644 --- a/tests/format/substitutions.py +++ b/tests/format/substitutions.py @@ -2,9 +2,10 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import cli # pylint: disable=unused-import DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project", "default") diff --git a/tests/format/variables.py b/tests/format/variables.py index c5e8eebad..eb77aab45 100644 --- a/tests/format/variables.py +++ b/tests/format/variables.py @@ -10,7 +10,6 @@ from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "variables") diff --git a/tests/frontend/__init__.py b/tests/frontend/__init__.py index 65ecda3ef..dbaf9564d 100644 --- a/tests/frontend/__init__.py +++ b/tests/frontend/__init__.py @@ -1,4 +1,5 @@ import os + from buildstream import _yaml diff --git a/tests/frontend/artifact_delete.py b/tests/frontend/artifact_delete.py index 2651f567e..ecaea359b 100644 --- a/tests/frontend/artifact_delete.py +++ b/tests/frontend/artifact_delete.py @@ -19,13 +19,14 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.element import _get_normal_name from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import -from tests.testutils import create_artifact_share +from tests.testutils import create_artifact_share # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/artifact_list_contents.py b/tests/frontend/artifact_list_contents.py index 8bd7bdeff..aec3953eb 100644 --- a/tests/frontend/artifact_list_contents.py +++ b/tests/frontend/artifact_list_contents.py @@ -19,11 +19,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli # pylint: disable=unused-import - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/artifact_log.py b/tests/frontend/artifact_log.py index 6ea610a25..0bc07bcc5 100644 --- a/tests/frontend/artifact_log.py +++ b/tests/frontend/artifact_log.py @@ -19,11 +19,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli # pylint: disable=unused-import - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/artifact_show.py b/tests/frontend/artifact_show.py index de9b78c45..fa3f09a3d 100644 --- a/tests/frontend/artifact_show.py +++ b/tests/frontend/artifact_show.py @@ -19,12 +19,13 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import -from tests.testutils import create_artifact_share +from tests.testutils import create_artifact_share # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index ca88a1368..5830fc877 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -1,21 +1,20 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -import os -import tarfile import hashlib +import os import re +import tarfile import pytest +from buildstream import _yaml, utils +from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo -from buildstream.testing._utils.site import IS_WINDOWS, CASD_SEPARATE_USER -from buildstream import _yaml -from buildstream.exceptions import ErrorDomain, LoadErrorReason -from buildstream import utils +from buildstream.testing._utils.site import CASD_SEPARATE_USER, IS_WINDOWS -from tests.testutils import generate_junction, create_artifact_share +from tests.testutils import create_artifact_share, generate_junction from . import configure_project diff --git a/tests/frontend/completions.py b/tests/frontend/completions.py index a5e3c8ed3..af26a98e8 100644 --- a/tests/frontend/completions.py +++ b/tests/frontend/completions.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.testing import cli # pylint: disable=unused-import # Project directory diff --git a/tests/frontend/compose_splits.py b/tests/frontend/compose_splits.py index d333b031e..33af86dc1 100644 --- a/tests/frontend/compose_splits.py +++ b/tests/frontend/compose_splits.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.testing.runcli import cli # pylint: disable=unused-import # Project directory diff --git a/tests/frontend/configurable_warnings.py b/tests/frontend/configurable_warnings.py index 53409a512..200269147 100644 --- a/tests/frontend/configurable_warnings.py +++ b/tests/frontend/configurable_warnings.py @@ -5,9 +5,9 @@ import os import pytest -from buildstream.plugin import CoreWarnings -from buildstream.exceptions import ErrorDomain from buildstream import _yaml +from buildstream.exceptions import ErrorDomain +from buildstream.plugin import CoreWarnings from buildstream.testing.runcli import cli # pylint: disable=unused-import TOP_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "configuredwarning") diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py index 5e25d1fa8..ac7746ed1 100644 --- a/tests/frontend/cross_junction_workspace.py +++ b/tests/frontend/cross_junction_workspace.py @@ -2,9 +2,10 @@ # pylint: disable=redefined-outer-name import os + +from buildstream import _yaml from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo -from buildstream import _yaml def prepare_junction_project(cli, tmpdir): diff --git a/tests/frontend/default_target.py b/tests/frontend/default_target.py index bb7a49592..540c25449 100644 --- a/tests/frontend/default_target.py +++ b/tests/frontend/default_target.py @@ -7,6 +7,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli, create_repo # pylint: disable=unused-import + from tests.testutils import create_artifact_share # project directory diff --git a/tests/frontend/fetch.py b/tests/frontend/fetch.py index b2c9d64c2..1d498d0e8 100644 --- a/tests/frontend/fetch.py +++ b/tests/frontend/fetch.py @@ -2,12 +2,13 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.testing import generate_project from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import generate_project from tests.testutils import generate_junction diff --git a/tests/frontend/help.py b/tests/frontend/help.py index 20a93160f..cc21c6ba4 100644 --- a/tests/frontend/help.py +++ b/tests/frontend/help.py @@ -2,6 +2,7 @@ # pylint: disable=redefined-outer-name import pytest + from buildstream.testing.runcli import cli # pylint: disable=unused-import diff --git a/tests/frontend/init.py b/tests/frontend/init.py index 3f897fb14..a4716b19e 100644 --- a/tests/frontend/init.py +++ b/tests/frontend/init.py @@ -2,13 +2,13 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import cli # pylint: disable=unused-import -from buildstream import _yaml -from buildstream import utils +from buildstream import _yaml, utils from buildstream._frontend.app import App from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import def get_default_min_version(): diff --git a/tests/frontend/interactive_init.py b/tests/frontend/interactive_init.py index b8cbe522f..0865d5ffc 100644 --- a/tests/frontend/interactive_init.py +++ b/tests/frontend/interactive_init.py @@ -2,8 +2,8 @@ import os import pexpect -from buildstream import _yaml -from buildstream import utils +from buildstream import _yaml, utils + from tests.testutils.constants import PEXPECT_TIMEOUT_SHORT diff --git a/tests/frontend/large_directory.py b/tests/frontend/large_directory.py index ea29fd1ca..47e2fc731 100644 --- a/tests/frontend/large_directory.py +++ b/tests/frontend/large_directory.py @@ -18,15 +18,15 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -from contextlib import contextmanager import os -import pytest +from contextlib import contextmanager import grpc +import pytest from buildstream.testing import cli # pylint: disable=unused-import -from tests.testutils import create_artifact_share, assert_shared +from tests.testutils import assert_shared, create_artifact_share # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py index 6eb058990..da8c4fee4 100644 --- a/tests/frontend/logging.py +++ b/tests/frontend/logging.py @@ -6,11 +6,10 @@ import re import pytest -from buildstream.testing import create_repo - from buildstream import _yaml from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import create_repo # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/mirror.py b/tests/frontend/mirror.py index bffc754e7..3bb0a932c 100644 --- a/tests/frontend/mirror.py +++ b/tests/frontend/mirror.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml -from buildstream.testing import create_repo from buildstream.testing import cli # pylint: disable=unused-import - +from buildstream.testing import create_repo # Project directory TOP_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/frontend/order.py b/tests/frontend/order.py index fbeb7c398..9c71a4ed9 100644 --- a/tests/frontend/order.py +++ b/tests/frontend/order.py @@ -4,9 +4,10 @@ import os import pytest -from buildstream.testing import create_repo -from buildstream.testing import cli # pylint: disable=unused-import + from buildstream import _yaml +from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import create_repo # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/overlaps.py b/tests/frontend/overlaps.py index a45fc700d..0887ef0fb 100644 --- a/tests/frontend/overlaps.py +++ b/tests/frontend/overlaps.py @@ -2,11 +2,14 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing.runcli import cli # pylint: disable=unused-import -from buildstream.exceptions import ErrorDomain + from buildstream import _yaml +from buildstream.exceptions import ErrorDomain from buildstream.plugin import CoreWarnings +from buildstream.testing.runcli import cli # pylint: disable=unused-import + from tests.testutils import generate_junction # Project directory diff --git a/tests/frontend/progress.py b/tests/frontend/progress.py index 5d446bb10..e6a736d96 100644 --- a/tests/frontend/progress.py +++ b/tests/frontend/progress.py @@ -2,11 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import cli # pylint: disable=unused-import from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import generate_junction diff --git a/tests/frontend/pull.py b/tests/frontend/pull.py index c1fa76ab0..f54ab4577 100644 --- a/tests/frontend/pull.py +++ b/tests/frontend/pull.py @@ -4,19 +4,21 @@ import os import shutil import stat + import pytest -from buildstream import utils, _yaml + +from buildstream import _yaml, utils from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo + from tests.testutils import ( + assert_not_shared, + assert_shared, create_artifact_share, create_split_share, generate_junction, - assert_shared, - assert_not_shared, ) - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 50e35461f..a6481841d 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -25,20 +25,21 @@ import os import shutil + import pytest from buildstream.exceptions import ErrorDomain from buildstream.testing import cli, generate_project # pylint: disable=unused-import + from tests.testutils import ( + assert_not_shared, + assert_shared, create_artifact_share, create_element_size, generate_junction, wait_for_cache_granularity, - assert_shared, - assert_not_shared, ) - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/rebuild.py b/tests/frontend/rebuild.py index 1aef8e423..0d2100b10 100644 --- a/tests/frontend/rebuild.py +++ b/tests/frontend/rebuild.py @@ -2,7 +2,9 @@ # pylint: disable=redefined-outer-name import os + import pytest + from buildstream.testing import cli # pylint: disable=unused-import # Project directory diff --git a/tests/frontend/remote-caches.py b/tests/frontend/remote-caches.py index b112e0882..2e66bc5e3 100644 --- a/tests/frontend/remote-caches.py +++ b/tests/frontend/remote-caches.py @@ -21,10 +21,11 @@ # pylint: disable=redefined-outer-name import os import shutil + import pytest -from buildstream.testing import cli # pylint: disable=unused-import from buildstream import _yaml +from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import create_artifact_share, create_element_size diff --git a/tests/frontend/show.py b/tests/frontend/show.py index 4be4b72e9..8468ca5a1 100644 --- a/tests/frontend/show.py +++ b/tests/frontend/show.py @@ -1,14 +1,16 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name +import itertools import os -import sys import shutil -import itertools +import sys + import pytest -from buildstream.testing import cli # pylint: disable=unused-import + from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import from tests.testutils import generate_junction diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py index 58c59ec7d..d123089ab 100644 --- a/tests/frontend/source_checkout.py +++ b/tests/frontend/source_checkout.py @@ -6,10 +6,9 @@ import tarfile import pytest +from buildstream import _yaml, utils from buildstream.testing import cli # pylint: disable=unused-import -from buildstream import utils, _yaml - # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/frontend/track.py b/tests/frontend/track.py index 2ebaae81f..9de0a294c 100644 --- a/tests/frontend/track.py +++ b/tests/frontend/track.py @@ -1,15 +1,18 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -import stat import os +import stat + import pytest -from buildstream.testing import create_repo -from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream import _yaml +from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import create_repo + from tests.testutils import generate_junction + from . import configure_project # Project directory diff --git a/tests/frontend/version.py b/tests/frontend/version.py index 279a51747..74ed9a50f 100644 --- a/tests/frontend/version.py +++ b/tests/frontend/version.py @@ -1,11 +1,9 @@ # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -from buildstream.testing.runcli import cli # pylint: disable=unused-import - - # For utils.get_bst_version() from buildstream import utils +from buildstream.testing.runcli import cli # pylint: disable=unused-import def assert_version(cli_version_output): diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 4aae61ad7..d73f20089 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -28,17 +28,17 @@ # pylint: disable=redefined-outer-name import os -import stat import shutil +import stat import subprocess import pytest -from buildstream.testing import create_repo, ALL_REPO_KINDS -from buildstream.testing import cli # pylint: disable=unused-import from buildstream import _yaml -from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream._workspaces import BST_WORKSPACE_FORMAT_VERSION +from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import ALL_REPO_KINDS, create_repo from tests.testutils import create_artifact_share, create_element_size, wait_for_cache_granularity diff --git a/tests/integration/artifact.py b/tests/integration/artifact.py index e21dd4296..36a76f2f1 100644 --- a/tests/integration/artifact.py +++ b/tests/integration/artifact.py @@ -31,7 +31,6 @@ from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import create_artifact_share - pytestmark = pytest.mark.integration diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index d1ab82e53..e6b146422 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/autotools.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing.integration import assert_contains from buildstream.testing._utils.site import HAVE_SANDBOX - +from buildstream.testing.integration import assert_contains pytestmark = pytest.mark.integration diff --git a/tests/integration/build-uid.py b/tests/integration/build-uid.py index a0cc20d3e..2eb79a1e3 100644 --- a/tests/integration/build-uid.py +++ b/tests/integration/build-uid.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_SANDBOX, BUILDBOX_RUN - +from buildstream.testing._utils.site import BUILDBOX_RUN, HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py index f72c315d5..64ad8095f 100644 --- a/tests/integration/cachedfail.py +++ b/tests/integration/cachedfail.py @@ -18,16 +18,16 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream import utils, _yaml +from buildstream import _yaml, utils from buildstream.exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import create_artifact_share - pytestmark = pytest.mark.integration diff --git a/tests/integration/compose-symlinks.py b/tests/integration/compose-symlinks.py index 7b807d1d5..f9e8987f7 100644 --- a/tests/integration/compose-symlinks.py +++ b/tests/integration/compose-symlinks.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import - pytestmark = pytest.mark.integration diff --git a/tests/integration/compose.py b/tests/integration/compose.py index f08f2e808..5f84b18c0 100644 --- a/tests/integration/compose.py +++ b/tests/integration/compose.py @@ -2,14 +2,13 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml - from buildstream.testing import cli_integration as cli # pylint: disable=unused-import +from buildstream.testing._utils.site import BUILDBOX_RUN, HAVE_SANDBOX from buildstream.testing.integration import walk_dir -from buildstream.testing._utils.site import HAVE_SANDBOX, BUILDBOX_RUN - pytestmark = pytest.mark.integration diff --git a/tests/integration/filter.py b/tests/integration/filter.py index 12061fe7a..557bf285b 100644 --- a/tests/integration/filter.py +++ b/tests/integration/filter.py @@ -3,12 +3,12 @@ import os import shutil + import pytest from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing._utils.site import BUILDBOX_RUN, HAVE_SANDBOX from buildstream.testing.integration import assert_contains -from buildstream.testing._utils.site import HAVE_SANDBOX, BUILDBOX_RUN - pytestmark = pytest.mark.integration diff --git a/tests/integration/import.py b/tests/integration/import.py index f7510e2e5..01bf8481b 100644 --- a/tests/integration/import.py +++ b/tests/integration/import.py @@ -2,14 +2,13 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml - from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import walk_dir - pytestmark = pytest.mark.integration diff --git a/tests/integration/interactive_build.py b/tests/integration/interactive_build.py index c0b087126..e43b99ef3 100644 --- a/tests/integration/interactive_build.py +++ b/tests/integration/interactive_build.py @@ -2,13 +2,14 @@ # pylint: disable=redefined-outer-name import os + import pexpect import pytest from buildstream.testing import runcli from buildstream.testing._utils.site import HAVE_SANDBOX -from tests.testutils.constants import PEXPECT_TIMEOUT_SHORT, PEXPECT_TIMEOUT_LONG +from tests.testutils.constants import PEXPECT_TIMEOUT_LONG, PEXPECT_TIMEOUT_SHORT pytestmark = pytest.mark.integration diff --git a/tests/integration/manual.py b/tests/integration/manual.py index defc2503c..110eac147 100644 --- a/tests/integration/manual.py +++ b/tests/integration/manual.py @@ -3,14 +3,13 @@ import os import shutil + import pytest from buildstream import _yaml - from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration diff --git a/tests/integration/messages.py b/tests/integration/messages.py index 1a324a61f..8cfa3dd35 100644 --- a/tests/integration/messages.py +++ b/tests/integration/messages.py @@ -21,6 +21,7 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml @@ -28,7 +29,6 @@ from buildstream.exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration diff --git a/tests/integration/pip_source.py b/tests/integration/pip_source.py index 5d314974d..025562453 100644 --- a/tests/integration/pip_source.py +++ b/tests/integration/pip_source.py @@ -2,17 +2,16 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml - from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing.integration import assert_contains from buildstream.testing._utils.site import HAVE_SANDBOX +from buildstream.testing.integration import assert_contains from tests.testutils.python_repo import setup_pypi_repo # pylint: disable=unused-import - pytestmark = pytest.mark.integration diff --git a/tests/integration/pullbuildtrees.py b/tests/integration/pullbuildtrees.py index 6d9eefb26..3209c36ad 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -6,13 +6,13 @@ import shutil import pytest -from buildstream.testing import cli, cli_integration as cli2 # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_SANDBOX from buildstream.exceptions import ErrorDomain, LoadErrorReason +from buildstream.testing import cli +from buildstream.testing import cli_integration as cli2 # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import create_artifact_share - pytestmark = pytest.mark.integration diff --git a/tests/integration/sandbox.py b/tests/integration/sandbox.py index cfa177e5e..1de1e3bca 100644 --- a/tests/integration/sandbox.py +++ b/tests/integration/sandbox.py @@ -19,12 +19,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration diff --git a/tests/integration/script.py b/tests/integration/script.py index 35a3fddaf..503806178 100644 --- a/tests/integration/script.py +++ b/tests/integration/script.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_SANDBOX, BUILDBOX_RUN - +from buildstream.testing._utils.site import BUILDBOX_RUN, HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/shell.py b/tests/integration/shell.py index 42e486bac..2b00014ea 100644 --- a/tests/integration/shell.py +++ b/tests/integration/shell.py @@ -6,15 +6,13 @@ import uuid import pytest -from buildstream import _yaml -from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_SANDBOX, BUILDBOX_RUN +from buildstream import _yaml, utils from buildstream.exceptions import ErrorDomain -from buildstream import utils +from buildstream.testing import cli_integration as cli # pylint: disable=unused-import +from buildstream.testing._utils.site import BUILDBOX_RUN, HAVE_SANDBOX from tests.testutils import create_artifact_share - pytestmark = pytest.mark.integration diff --git a/tests/integration/shellbuildtrees.py b/tests/integration/shellbuildtrees.py index 0d80c1640..b99a754c0 100644 --- a/tests/integration/shellbuildtrees.py +++ b/tests/integration/shellbuildtrees.py @@ -6,13 +6,12 @@ import shutil import pytest -from buildstream.testing import cli, cli_integration # pylint: disable=unused-import from buildstream.exceptions import ErrorDomain +from buildstream.testing import cli, cli_integration # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import create_artifact_share - pytestmark = pytest.mark.integration diff --git a/tests/integration/sockets.py b/tests/integration/sockets.py index 3fb656e95..32f904bc5 100644 --- a/tests/integration/sockets.py +++ b/tests/integration/sockets.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") diff --git a/tests/integration/source-determinism.py b/tests/integration/source-determinism.py index a69e55a23..940de3161 100644 --- a/tests/integration/source-determinism.py +++ b/tests/integration/source-determinism.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_SANDBOX, CASD_SEPARATE_USER - +from buildstream.testing._utils.site import CASD_SEPARATE_USER, HAVE_SANDBOX DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") diff --git a/tests/integration/stack.py b/tests/integration/stack.py index bad807fd6..dd0a12a7f 100644 --- a/tests/integration/stack.py +++ b/tests/integration/stack.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration diff --git a/tests/integration/symlinks.py b/tests/integration/symlinks.py index f1d044f07..d25a57c4b 100644 --- a/tests/integration/symlinks.py +++ b/tests/integration/symlinks.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX - pytestmark = pytest.mark.integration diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py index a2ea4841a..78e4bc128 100644 --- a/tests/integration/workspace.py +++ b/tests/integration/workspace.py @@ -2,17 +2,17 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml +from buildstream.exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX -from buildstream.exceptions import ErrorDomain from buildstream.utils import BST_ARBITRARY_TIMESTAMP from tests.testutils import wait_for_cache_granularity - pytestmark = pytest.mark.integration diff --git a/tests/internals/context.py b/tests/internals/context.py index 9d06a68bf..2743dfa12 100644 --- a/tests/internals/context.py +++ b/tests/internals/context.py @@ -2,10 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream._context import Context from buildstream import _yaml, utils +from buildstream._context import Context from buildstream._exceptions import LoadError from buildstream.exceptions import LoadErrorReason diff --git a/tests/internals/loader.py b/tests/internals/loader.py index bdce428f0..17cd27815 100644 --- a/tests/internals/loader.py +++ b/tests/internals/loader.py @@ -1,15 +1,15 @@ -from contextlib import contextmanager import os +from contextlib import contextmanager + import pytest -from buildstream.exceptions import LoadErrorReason from buildstream._exceptions import LoadError -from buildstream._project import Project from buildstream._loader import MetaElement +from buildstream._project import Project +from buildstream.exceptions import LoadErrorReason from tests.testutils import dummy_context - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "loader",) diff --git a/tests/internals/pluginloading.py b/tests/internals/pluginloading.py index 1f4446541..284c6ff5c 100644 --- a/tests/internals/pluginloading.py +++ b/tests/internals/pluginloading.py @@ -1,9 +1,10 @@ -from contextlib import contextmanager import os +from contextlib import contextmanager + import pytest -from buildstream._project import Project from buildstream._pipeline import Pipeline +from buildstream._project import Project from tests.testutils import dummy_context diff --git a/tests/internals/storage.py b/tests/internals/storage.py index e9932e0a4..410d5feaa 100644 --- a/tests/internals/storage.py +++ b/tests/internals/storage.py @@ -1,10 +1,10 @@ -from contextlib import contextmanager +import glob +import hashlib import os import pprint import shutil import stat -import glob -import hashlib +from contextlib import contextmanager from pathlib import Path from typing import List, Optional @@ -13,7 +13,7 @@ import pytest from buildstream._cas import CASCache from buildstream.storage._casbaseddirectory import CasBasedDirectory from buildstream.storage._filebaseddirectory import FileBasedDirectory -from buildstream.storage.directory import _FileType, VirtualDirectoryError +from buildstream.storage.directory import VirtualDirectoryError, _FileType DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "storage") diff --git a/tests/internals/storage_vdir_import.py b/tests/internals/storage_vdir_import.py index ffd727ffe..7088225ef 100644 --- a/tests/internals/storage_vdir_import.py +++ b/tests/internals/storage_vdir_import.py @@ -13,18 +13,17 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see <http://www.gnu.org/licenses/>. -from hashlib import sha256 import os import random +from hashlib import sha256 import pytest +from buildstream._cas import CASCache from buildstream.storage._casbaseddirectory import CasBasedDirectory from buildstream.storage._filebaseddirectory import FileBasedDirectory -from buildstream._cas import CASCache from buildstream.storage.directory import VirtualDirectoryError -from buildstream.utils import _set_file_mtime, _parse_timestamp - +from buildstream.utils import _parse_timestamp, _set_file_mtime # These are comparitive tests that check that FileBasedDirectory and # CasBasedDirectory act identically. diff --git a/tests/internals/utils_move_atomic.py b/tests/internals/utils_move_atomic.py index dd417cb66..9022d8316 100644 --- a/tests/internals/utils_move_atomic.py +++ b/tests/internals/utils_move_atomic.py @@ -4,11 +4,11 @@ import pytest from buildstream.utils import ( - move_atomic, DirectoryExistsError, _get_file_mtimestamp, - _set_file_mtime, _parse_timestamp, + _set_file_mtime, + move_atomic, ) diff --git a/tests/internals/utils_save_atomic.py b/tests/internals/utils_save_atomic.py index 898286076..d1d394950 100644 --- a/tests/internals/utils_save_atomic.py +++ b/tests/internals/utils_save_atomic.py @@ -1,4 +1,5 @@ import os + import pytest from buildstream.utils import save_file_atomic diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py index a4f8d08cc..e6509ce36 100644 --- a/tests/internals/yaml.py +++ b/tests/internals/yaml.py @@ -3,10 +3,9 @@ from io import StringIO import pytest -from buildstream import _yaml, Node, ProvenanceInformation, SequenceNode -from buildstream.exceptions import LoadErrorReason +from buildstream import Node, ProvenanceInformation, SequenceNode, _yaml from buildstream._exceptions import LoadError - +from buildstream.exceptions import LoadErrorReason DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "yaml",) diff --git a/tests/plugins/loading.py b/tests/plugins/loading.py index 7aeb242f3..e62cd5238 100644 --- a/tests/plugins/loading.py +++ b/tests/plugins/loading.py @@ -8,12 +8,12 @@ import os import shutil + import pytest +from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import -from buildstream import _yaml - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "loading") diff --git a/tests/plugins/sample-plugins/setup.py b/tests/plugins/sample-plugins/setup.py index 8429c7cd7..920f19ff0 100755 --- a/tests/plugins/sample-plugins/setup.py +++ b/tests/plugins/sample-plugins/setup.py @@ -16,7 +16,7 @@ # License along with this library. If not, see <http://www.gnu.org/licenses/>. # -from setuptools import setup, find_packages +from setuptools import find_packages, setup setup( name="sample-plugins", diff --git a/tests/remoteexecution/buildfail.py b/tests/remoteexecution/buildfail.py index 37f4dcafa..f78293947 100644 --- a/tests/remoteexecution/buildfail.py +++ b/tests/remoteexecution/buildfail.py @@ -19,10 +19,11 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.exceptions import ErrorDomain from buildstream import _yaml +from buildstream.exceptions import ErrorDomain from buildstream.testing import cli_remote_execution as cli # pylint: disable=unused-import pytestmark = pytest.mark.remoteexecution diff --git a/tests/remoteexecution/buildtree.py b/tests/remoteexecution/buildtree.py index 57e25cd14..0c805d6a5 100644 --- a/tests/remoteexecution/buildtree.py +++ b/tests/remoteexecution/buildtree.py @@ -19,6 +19,7 @@ import os import shutil + import pytest from buildstream.testing import cli_remote_execution as cli # pylint: disable=unused-import diff --git a/tests/remoteexecution/junction.py b/tests/remoteexecution/junction.py index 2b0261612..7c39b6209 100644 --- a/tests/remoteexecution/junction.py +++ b/tests/remoteexecution/junction.py @@ -19,10 +19,13 @@ # pylint: disable=redefined-outer-name import os + import pytest + +from buildstream import _yaml from buildstream.testing import cli_remote_execution as cli # pylint: disable=unused-import from buildstream.testing import create_repo -from buildstream import _yaml + from tests.testutils import generate_junction pytestmark = pytest.mark.remoteexecution diff --git a/tests/remoteexecution/partial.py b/tests/remoteexecution/partial.py index ec5fabedb..1ea8feaba 100644 --- a/tests/remoteexecution/partial.py +++ b/tests/remoteexecution/partial.py @@ -2,6 +2,7 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain @@ -10,7 +11,6 @@ from buildstream.testing.integration import assert_contains from tests.testutils.artifactshare import create_artifact_share - pytestmark = pytest.mark.remoteexecution diff --git a/tests/remoteexecution/simple.py b/tests/remoteexecution/simple.py index cb8f80930..791dbc300 100644 --- a/tests/remoteexecution/simple.py +++ b/tests/remoteexecution/simple.py @@ -2,12 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli_remote_execution as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains - pytestmark = pytest.mark.remoteexecution diff --git a/tests/remoteexecution/workspace.py b/tests/remoteexecution/workspace.py index b525cefcd..1e8d8ecb6 100644 --- a/tests/remoteexecution/workspace.py +++ b/tests/remoteexecution/workspace.py @@ -4,6 +4,7 @@ import os import re import shutil + import pytest from buildstream.testing import cli_remote_execution as cli # pylint: disable=unused-import diff --git a/tests/sandboxes/missing-command.py b/tests/sandboxes/missing-command.py index ec6ba184b..780a872a6 100644 --- a/tests/sandboxes/missing-command.py +++ b/tests/sandboxes/missing-command.py @@ -2,13 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain - from buildstream.testing import cli # pylint: disable=unused-import - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "missing-command") diff --git a/tests/sandboxes/missing_dependencies.py b/tests/sandboxes/missing_dependencies.py index 7ac7d7868..84bc78fd5 100644 --- a/tests/sandboxes/missing_dependencies.py +++ b/tests/sandboxes/missing_dependencies.py @@ -5,11 +5,10 @@ import os import pytest -from buildstream import utils, _yaml +from buildstream import _yaml, utils from buildstream.exceptions import ErrorDomain -from buildstream.testing._utils.site import IS_LINUX from buildstream.testing import cli # pylint: disable=unused-import - +from buildstream.testing._utils.site import IS_LINUX # Project directory DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "missing-dependencies",) diff --git a/tests/sandboxes/selection.py b/tests/sandboxes/selection.py index 0118fb5e0..a98395f3c 100644 --- a/tests/sandboxes/selection.py +++ b/tests/sandboxes/selection.py @@ -17,9 +17,10 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream import utils, _yaml +from buildstream import _yaml, utils from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import diff --git a/tests/sourcecache/cache.py b/tests/sourcecache/cache.py index bbc3d8329..0f38d2f4c 100644 --- a/tests/sourcecache/cache.py +++ b/tests/sourcecache/cache.py @@ -22,10 +22,11 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing.runcli import cli # pylint: disable=unused-import from buildstream import _yaml +from buildstream.testing.runcli import cli # pylint: disable=unused-import DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") diff --git a/tests/sourcecache/capabilities.py b/tests/sourcecache/capabilities.py index 9d41eba11..8c97fd8ee 100644 --- a/tests/sourcecache/capabilities.py +++ b/tests/sourcecache/capabilities.py @@ -4,15 +4,14 @@ import os import pytest -from buildstream._project import Project from buildstream import _yaml +from buildstream._project import Project from buildstream.testing.runcli import cli # pylint: disable=unused-import -from tests.testutils import dummy_context +from tests.testutils import dummy_context from tests.testutils.artifactshare import create_dummy_artifact_share - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) diff --git a/tests/sourcecache/config.py b/tests/sourcecache/config.py index 0c11a2726..514f1321d 100644 --- a/tests/sourcecache/config.py +++ b/tests/sourcecache/config.py @@ -22,11 +22,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason - from buildstream.testing.runcli import cli # pylint: disable=unused-import DATA_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/sourcecache/fetch.py b/tests/sourcecache/fetch.py index 889de62f0..654fb22c1 100644 --- a/tests/sourcecache/fetch.py +++ b/tests/sourcecache/fetch.py @@ -19,14 +19,15 @@ # # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name -from contextlib import contextmanager import os import shutil +from contextlib import contextmanager + import pytest -from buildstream.exceptions import ErrorDomain -from buildstream._project import Project from buildstream import _yaml +from buildstream._project import Project +from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo diff --git a/tests/sourcecache/project/plugins/elements/always_fail.py b/tests/sourcecache/project/plugins/elements/always_fail.py index bc3ed57b6..7dc908ee6 100644 --- a/tests/sourcecache/project/plugins/elements/always_fail.py +++ b/tests/sourcecache/project/plugins/elements/always_fail.py @@ -18,8 +18,8 @@ # Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk> # -from buildstream.element import ElementError from buildstream.buildelement import BuildElement +from buildstream.element import ElementError class AlwaysFail(BuildElement): diff --git a/tests/sourcecache/push.py b/tests/sourcecache/push.py index 9f8663a4a..ff6ef1c97 100644 --- a/tests/sourcecache/push.py +++ b/tests/sourcecache/push.py @@ -21,15 +21,16 @@ # pylint: disable=redefined-outer-name import os import shutil -from contextlib import contextmanager, ExitStack +from contextlib import ExitStack, contextmanager import pytest -from buildstream.exceptions import ErrorDomain -from buildstream._project import Project from buildstream import _yaml +from buildstream._project import Project +from buildstream.exceptions import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing import create_repo + from tests.testutils import create_artifact_share, dummy_context DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") diff --git a/tests/sourcecache/staging.py b/tests/sourcecache/staging.py index dbfc028f2..fa30c5c4c 100644 --- a/tests/sourcecache/staging.py +++ b/tests/sourcecache/staging.py @@ -23,16 +23,15 @@ import os import shutil + import pytest from buildstream._project import Project - from buildstream.testing.runcli import cli # pylint: disable=unused-import from tests.testutils import dummy_context from tests.testutils.element_generators import create_element_size - DATA_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/sourcecache/workspace.py b/tests/sourcecache/workspace.py index bb1ea505a..c970296d6 100644 --- a/tests/sourcecache/workspace.py +++ b/tests/sourcecache/workspace.py @@ -31,7 +31,6 @@ from buildstream.testing.runcli import cli # pylint: disable=unused-import from tests.testutils.artifactshare import create_artifact_share from tests.testutils.element_generators import create_element_size - DATA_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/sources/bzr.py b/tests/sources/bzr.py index 2dcacfef5..2bd4c75ca 100644 --- a/tests/sources/bzr.py +++ b/tests/sources/bzr.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.testing import create_repo -from buildstream.testing import generate_element +from buildstream.testing import create_repo, generate_element from buildstream.testing._utils.site import HAVE_BZR DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "bzr") diff --git a/tests/sources/git.py b/tests/sources/git.py index 033db1bf9..d6ac46e99 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -24,8 +24,8 @@ # pylint: disable=redefined-outer-name import os -import subprocess import shutil +import subprocess import pytest @@ -33,8 +33,7 @@ from buildstream import Node from buildstream.exceptions import ErrorDomain from buildstream.plugin import CoreWarnings from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.testing import generate_project, generate_element, load_yaml -from buildstream.testing import create_repo +from buildstream.testing import create_repo, generate_element, generate_project, load_yaml from buildstream.testing._utils.site import HAVE_GIT, HAVE_OLD_GIT DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "git",) diff --git a/tests/sources/keytest.py b/tests/sources/keytest.py index 70e01f60f..3bee77150 100644 --- a/tests/sources/keytest.py +++ b/tests/sources/keytest.py @@ -22,10 +22,11 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import ErrorDomain from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import ErrorDomain DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project_key_test") diff --git a/tests/sources/local.py b/tests/sources/local.py index 2b0155107..2b3bc2a92 100644 --- a/tests/sources/local.py +++ b/tests/sources/local.py @@ -2,12 +2,14 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream import _yaml from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX + from tests.testutils import filetypegenerator DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "local",) diff --git a/tests/sources/no_fetch_cached.py b/tests/sources/no_fetch_cached.py index 4984f5326..96b94e9f9 100644 --- a/tests/sources/no_fetch_cached.py +++ b/tests/sources/no_fetch_cached.py @@ -2,11 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.testing import cli # pylint: disable=unused-import -from buildstream.testing import create_repo -from buildstream.testing import generate_element +from buildstream.testing import create_repo, generate_element from buildstream.testing._utils.site import HAVE_GIT DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "no-fetch-cached") diff --git a/tests/sources/patch.py b/tests/sources/patch.py index 5392a64cb..99068f056 100644 --- a/tests/sources/patch.py +++ b/tests/sources/patch.py @@ -2,10 +2,12 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import + from tests.testutils import filetypegenerator DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "patch",) diff --git a/tests/sources/pip.py b/tests/sources/pip.py index 1eacb4462..44a5aa402 100644 --- a/tests/sources/pip.py +++ b/tests/sources/pip.py @@ -2,6 +2,7 @@ # pylint: disable=redefined-outer-name import os + import pytest from buildstream.exceptions import ErrorDomain diff --git a/tests/sources/previous_source_access.py b/tests/sources/previous_source_access.py index 3c95d77e2..15d0993aa 100644 --- a/tests/sources/previous_source_access.py +++ b/tests/sources/previous_source_access.py @@ -2,10 +2,11 @@ # pylint: disable=redefined-outer-name import os + import pytest -from buildstream.testing import generate_project, load_yaml from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import generate_project, load_yaml DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "previous_source_access") diff --git a/tests/sources/previous_source_access/plugins/sources/foo_transform.py b/tests/sources/previous_source_access/plugins/sources/foo_transform.py index 15fef43f8..9b9e1adf6 100644 --- a/tests/sources/previous_source_access/plugins/sources/foo_transform.py +++ b/tests/sources/previous_source_access/plugins/sources/foo_transform.py @@ -7,8 +7,8 @@ previous sources, and copies its contents to a file called "filetransform". """ -import os import hashlib +import os from buildstream import Source, SourceError, utils diff --git a/tests/sources/remote.py b/tests/sources/remote.py index 416d2d53c..7dc694f21 100644 --- a/tests/sources/remote.py +++ b/tests/sources/remote.py @@ -3,12 +3,13 @@ import os import stat + import pytest from buildstream import utils -from buildstream.testing import ErrorDomain -from buildstream.testing import generate_project from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import ErrorDomain, generate_project + from tests.testutils.file_server import create_file_server DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "remote",) diff --git a/tests/sources/tar.py b/tests/sources/tar.py index ed662dcd2..9ccedcb80 100644 --- a/tests/sources/tar.py +++ b/tests/sources/tar.py @@ -2,20 +2,22 @@ # pylint: disable=redefined-outer-name import os -from shutil import copyfile import subprocess import tarfile import tempfile import urllib.parse +from shutil import copyfile import pytest from buildstream import utils from buildstream.exceptions import ErrorDomain -from buildstream.testing import generate_project, generate_element from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import generate_element, generate_project from buildstream.testing._utils.site import HAVE_LZIP + from tests.testutils.file_server import create_file_server + from . import list_dir_contents DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "tar",) diff --git a/tests/sources/variables.py b/tests/sources/variables.py index 3e9a08fd8..26e9756a8 100644 --- a/tests/sources/variables.py +++ b/tests/sources/variables.py @@ -8,7 +8,6 @@ import pytest from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream.testing.runcli import cli # pylint: disable=unused-import - DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "variables") diff --git a/tests/sources/zip.py b/tests/sources/zip.py index 201271fe0..42ff1acda 100644 --- a/tests/sources/zip.py +++ b/tests/sources/zip.py @@ -7,9 +7,11 @@ import zipfile import pytest from buildstream.exceptions import ErrorDomain -from buildstream.testing import generate_project from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing import generate_project + from tests.testutils.file_server import create_file_server + from . import list_dir_contents DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "zip",) diff --git a/tests/testutils/__init__.py b/tests/testutils/__init__.py index 9642ddf47..f5825568c 100644 --- a/tests/testutils/__init__.py +++ b/tests/testutils/__init__.py @@ -23,10 +23,10 @@ # William Salmon <will.salmon@codethink.co.uk> # -from .artifactshare import create_artifact_share, create_split_share, assert_shared, assert_not_shared +from .artifactshare import assert_not_shared, assert_shared, create_artifact_share, create_split_share from .context import dummy_context from .element_generators import create_element_size, update_element_size from .junction import generate_junction -from .runner_integration import wait_for_cache_granularity -from .python_repo import setup_pypi_repo from .platform import override_platform_uname +from .python_repo import setup_pypi_repo +from .runner_integration import wait_for_cache_granularity diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py index a15a7c27e..fab2b7318 100644 --- a/tests/testutils/artifactshare.py +++ b/tests/testutils/artifactshare.py @@ -3,8 +3,8 @@ import shutil import signal import sys from collections import namedtuple -from contextlib import ExitStack, contextmanager from concurrent import futures +from contextlib import ExitStack, contextmanager from multiprocessing import Process, Queue import grpc diff --git a/tests/testutils/context.py b/tests/testutils/context.py index 821adef0a..69d999eef 100644 --- a/tests/testutils/context.py +++ b/tests/testutils/context.py @@ -15,9 +15,8 @@ # License along with this library. If not, see <http://www.gnu.org/licenses/>. import os - -from types import MethodType from contextlib import contextmanager +from types import MethodType from buildstream._context import Context diff --git a/tests/testutils/element_generators.py b/tests/testutils/element_generators.py index 6da465ab7..441a59fd1 100644 --- a/tests/testutils/element_generators.py +++ b/tests/testutils/element_generators.py @@ -1,7 +1,6 @@ import os -from buildstream import _yaml -from buildstream import utils +from buildstream import _yaml, utils from buildstream.testing import create_repo diff --git a/tests/testutils/http_server.py b/tests/testutils/http_server.py index 8591159f8..d27bfb062 100644 --- a/tests/testutils/http_server.py +++ b/tests/testutils/http_server.py @@ -1,9 +1,9 @@ +import base64 +import html import multiprocessing import os import posixpath -import html -import base64 -from http.server import SimpleHTTPRequestHandler, HTTPServer, HTTPStatus +from http.server import HTTPServer, HTTPStatus, SimpleHTTPRequestHandler class Unauthorized(Exception): diff --git a/tests/testutils/platform.py b/tests/testutils/platform.py index f8faf286e..d42db416e 100644 --- a/tests/testutils/platform.py +++ b/tests/testutils/platform.py @@ -17,8 +17,8 @@ # Authors: # Angelos Evripiotis <jevripiotis@bloomberg.net> -from contextlib import contextmanager import platform +from contextlib import contextmanager # override_platform_uname() diff --git a/tests/testutils/python_repo.py b/tests/testutils/python_repo.py index 07efa376a..3666ffcc9 100644 --- a/tests/testutils/python_repo.py +++ b/tests/testutils/python_repo.py @@ -6,7 +6,6 @@ import sys import pytest - SETUP_TEMPLATE = """\ from setuptools import setup diff --git a/tests/testutils/repo/bzr.py b/tests/testutils/repo/bzr.py index b6983416e..e4f638843 100644 --- a/tests/testutils/repo/bzr.py +++ b/tests/testutils/repo/bzr.py @@ -1,5 +1,6 @@ import os import subprocess + import pytest from buildstream.testing import Repo diff --git a/tests/testutils/repo/tar.py b/tests/testutils/repo/tar.py index 3eb9d896b..c2228bea5 100644 --- a/tests/testutils/repo/tar.py +++ b/tests/testutils/repo/tar.py @@ -1,9 +1,8 @@ import os import tarfile -from buildstream.utils import sha256sum - from buildstream.testing import Repo +from buildstream.utils import sha256sum class Tar(Repo): diff --git a/tests/testutils/repo/zip.py b/tests/testutils/repo/zip.py index 38419e642..462e9c3c1 100644 --- a/tests/testutils/repo/zip.py +++ b/tests/testutils/repo/zip.py @@ -1,9 +1,8 @@ import os import zipfile -from buildstream.utils import sha256sum - from buildstream.testing import Repo +from buildstream.utils import sha256sum class Zip(Repo): diff --git a/tests/testutils/setuptools.py b/tests/testutils/setuptools.py index 0f7f30f91..9c000a09e 100644 --- a/tests/testutils/setuptools.py +++ b/tests/testutils/setuptools.py @@ -1,6 +1,7 @@ import os -import pytest + import pkg_resources +import pytest # A mock setuptools dist object. |