summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-09 10:51:46 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 09:38:41 +0000
commit7474ed1f38b7b750e1cd2b5ebbfe9fc0f3f3d364 (patch)
treef702fec85230e29ed0a9b709d1760249a58e5901
parent180b8ada3922f7a1b139d76559ebece2bb54579f (diff)
downloadbuildstream-7474ed1f38b7b750e1cd2b5ebbfe9fc0f3f3d364.tar.gz
tests:lint: reorder imports for consistency
- Remove all wrong-import-order from pylint - Order some subgroups of imports
-rw-r--r--tests/cachekey/cachekey.py10
-rw-r--r--tests/elements/filter.py4
-rw-r--r--tests/external_plugins.py3
-rw-r--r--tests/format/junctions.py3
-rw-r--r--tests/format/optionarch.py4
-rw-r--r--tests/format/optionos.py3
-rw-r--r--tests/format/variables.py4
-rw-r--r--tests/frontend/buildcheckout.py4
-rw-r--r--tests/frontend/configurable_warnings.py3
-rw-r--r--tests/frontend/logging.py4
-rw-r--r--tests/frontend/main.py6
-rw-r--r--tests/frontend/source_checkout.py3
-rw-r--r--tests/frontend/workspace.py4
-rw-r--r--tests/frontend/yamlcache.py5
-rw-r--r--tests/internals/storage_vdir_import.py5
-rw-r--r--tests/internals/yaml.py5
-rw-r--r--tests/sourcecache/source-checkout.py3
-rw-r--r--tests/sourcecache/workspace.py3
-rw-r--r--tests/sources/deb.py3
-rw-r--r--tests/sources/git.py3
-rw-r--r--tests/sources/tar.py7
-rw-r--r--tests/sources/zip.py3
-rw-r--r--tests/testutils/python_repo.py3
-rw-r--r--tests/testutils/repo/git.py3
-rw-r--r--tests/testutils/repo/ostree.py5
25 files changed, 67 insertions, 36 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 456e403d4..7d2a13e07 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -35,13 +35,15 @@
# run over to the corresponding .expected source files and commit
# the result.
#
+from collections import OrderedDict
+import os
+
+import pytest
+
from buildstream.plugintestutils.runcli import cli
-from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX, MACHINE_ARCH
from buildstream.plugin import CoreWarnings
from buildstream import _yaml
-import os
-from collections import OrderedDict
-import pytest
+from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX, MACHINE_ARCH
##############################################
diff --git a/tests/elements/filter.py b/tests/elements/filter.py
index a166b820c..4810265ab 100644
--- a/tests/elements/filter.py
+++ b/tests/elements/filter.py
@@ -1,6 +1,8 @@
import os
-import pytest
import shutil
+
+import pytest
+
from tests.testutils import create_repo
from buildstream.plugintestutils import cli
from buildstream._exceptions import ErrorDomain
diff --git a/tests/external_plugins.py b/tests/external_plugins.py
index 84a1abdce..b45f0ece1 100644
--- a/tests/external_plugins.py
+++ b/tests/external_plugins.py
@@ -1,11 +1,12 @@
import glob
import os
-import pytest
import shutil
import subprocess
import sys
import time
+import pytest
+
# An ExternalPluginRepo represents a git repository containing a plugin
# with tests that we wish to use as part of our test suite.
diff --git a/tests/format/junctions.py b/tests/format/junctions.py
index ab369b906..e86ef2082 100644
--- a/tests/format/junctions.py
+++ b/tests/format/junctions.py
@@ -1,7 +1,8 @@
import os
-import pytest
import shutil
+import pytest
+
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
from buildstream.plugintestutils import cli
diff --git a/tests/format/optionarch.py b/tests/format/optionarch.py
index a1237002d..0b5f05569 100644
--- a/tests/format/optionarch.py
+++ b/tests/format/optionarch.py
@@ -1,6 +1,8 @@
+from contextlib import contextmanager
import os
+
import pytest
-from contextlib import contextmanager
+
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
from buildstream.plugintestutils.runcli import cli
diff --git a/tests/format/optionos.py b/tests/format/optionos.py
index ba6ab2a48..3ab5ccb81 100644
--- a/tests/format/optionos.py
+++ b/tests/format/optionos.py
@@ -1,6 +1,7 @@
+from contextlib import contextmanager
import os
+
import pytest
-from contextlib import contextmanager
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
diff --git a/tests/format/variables.py b/tests/format/variables.py
index 3fa0f4790..688452541 100644
--- a/tests/format/variables.py
+++ b/tests/format/variables.py
@@ -1,6 +1,8 @@
import os
-import pytest
import sys
+
+import pytest
+
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
from buildstream.plugintestutils.runcli import cli
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index b1f000aa8..d8e4d2e42 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -1,8 +1,10 @@
import os
import tarfile
import hashlib
-import pytest
import subprocess
+
+import pytest
+
from tests.testutils.site import IS_WINDOWS
from tests.testutils import create_repo, generate_junction
diff --git a/tests/frontend/configurable_warnings.py b/tests/frontend/configurable_warnings.py
index 594c5a8e1..2de94186f 100644
--- a/tests/frontend/configurable_warnings.py
+++ b/tests/frontend/configurable_warnings.py
@@ -1,6 +1,7 @@
-import pytest
import os
+import pytest
+
from buildstream.plugin import CoreWarnings
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py
index 6ad792dc9..e75901c23 100644
--- a/tests/frontend/logging.py
+++ b/tests/frontend/logging.py
@@ -1,6 +1,8 @@
import os
-import pytest
import re
+
+import pytest
+
from tests.testutils import create_repo
from buildstream import _yaml
diff --git a/tests/frontend/main.py b/tests/frontend/main.py
index c330c39d9..03b8840ff 100644
--- a/tests/frontend/main.py
+++ b/tests/frontend/main.py
@@ -1,7 +1,7 @@
-from buildstream._frontend.app import _prefix_choice_value_proc
-
-import pytest
import click
+import pytest
+
+from buildstream._frontend.app import _prefix_choice_value_proc
def test_prefix_choice_value_proc_full_match():
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py
index 8466767f9..0b38959db 100644
--- a/tests/frontend/source_checkout.py
+++ b/tests/frontend/source_checkout.py
@@ -1,7 +1,8 @@
import os
-import pytest
import tarfile
+import pytest
+
from buildstream.plugintestutils import cli
from buildstream import utils, _yaml
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index f0ce48eb9..374d62ae8 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -26,9 +26,11 @@
import os
import stat
-import pytest
import shutil
import subprocess
+
+import pytest
+
from tests.testutils import create_repo, ALL_REPO_KINDS, wait_for_cache_granularity
from tests.testutils import create_artifact_share, create_element_size
diff --git a/tests/frontend/yamlcache.py b/tests/frontend/yamlcache.py
index 81514117e..f3a6dda41 100644
--- a/tests/frontend/yamlcache.py
+++ b/tests/frontend/yamlcache.py
@@ -1,6 +1,8 @@
+from contextlib import contextmanager
import os
-import pytest
import tempfile
+
+import pytest
from ruamel import yaml
from tests.testutils import generate_junction, create_element_size
@@ -9,7 +11,6 @@ from buildstream import _yaml
from buildstream._yamlcache import YamlCache
from buildstream._project import Project
from buildstream._context import Context
-from contextlib import contextmanager
def generate_project(tmpdir, ref_storage, with_junction, name="test"):
diff --git a/tests/internals/storage_vdir_import.py b/tests/internals/storage_vdir_import.py
index 616f740e2..01f08ca5c 100644
--- a/tests/internals/storage_vdir_import.py
+++ b/tests/internals/storage_vdir_import.py
@@ -1,9 +1,10 @@
from hashlib import sha256
import os
-import pytest
import random
-from buildstream.plugintestutils import cli
+import pytest
+
+from buildstream.plugintestutils import cli
from buildstream.storage._casbaseddirectory import CasBasedDirectory
from buildstream.storage._filebaseddirectory import FileBasedDirectory
from buildstream._cas import CASCache
diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py
index a7b4457e3..4870b5180 100644
--- a/tests/internals/yaml.py
+++ b/tests/internals/yaml.py
@@ -1,7 +1,8 @@
+from collections.abc import Mapping
import os
-import pytest
import tempfile
-from collections.abc import Mapping
+
+import pytest
from buildstream import _yaml
from buildstream._exceptions import LoadError, LoadErrorReason
diff --git a/tests/sourcecache/source-checkout.py b/tests/sourcecache/source-checkout.py
index f526dc586..b2333c993 100644
--- a/tests/sourcecache/source-checkout.py
+++ b/tests/sourcecache/source-checkout.py
@@ -18,9 +18,10 @@
# Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>
#
import os
-import pytest
import shutil
+import pytest
+
from buildstream._exceptions import ErrorDomain
from buildstream.plugintestutils.runcli import cli
diff --git a/tests/sourcecache/workspace.py b/tests/sourcecache/workspace.py
index 440ca81b8..587386134 100644
--- a/tests/sourcecache/workspace.py
+++ b/tests/sourcecache/workspace.py
@@ -18,9 +18,10 @@
# Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>
#
import os
-import pytest
import shutil
+import pytest
+
from buildstream.plugintestutils.runcli import cli
from tests.testutils.element_generators import create_element_size
diff --git a/tests/sources/deb.py b/tests/sources/deb.py
index 766f6fcc9..684c9e961 100644
--- a/tests/sources/deb.py
+++ b/tests/sources/deb.py
@@ -1,7 +1,8 @@
import os
-import pytest
import shutil
+import pytest
+
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
from buildstream.plugintestutils import cli
diff --git a/tests/sources/git.py b/tests/sources/git.py
index 1f05055e4..068affd03 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -21,10 +21,11 @@
#
import os
-import pytest
import subprocess
import shutil
+import pytest
+
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
from buildstream.plugin import CoreWarnings
diff --git a/tests/sources/tar.py b/tests/sources/tar.py
index 11f288b9a..8d7d37c56 100644
--- a/tests/sources/tar.py
+++ b/tests/sources/tar.py
@@ -1,10 +1,11 @@
import os
-import pytest
+from shutil import copyfile, rmtree
+import subprocess
import tarfile
import tempfile
-import subprocess
import urllib.parse
-from shutil import copyfile, rmtree
+
+import pytest
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
diff --git a/tests/sources/zip.py b/tests/sources/zip.py
index dd72dd579..c15453242 100644
--- a/tests/sources/zip.py
+++ b/tests/sources/zip.py
@@ -1,7 +1,8 @@
import os
-import pytest
import zipfile
+import pytest
+
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
from buildstream.plugintestutils import cli
diff --git a/tests/testutils/python_repo.py b/tests/testutils/python_repo.py
index 386e67014..9182bd9ba 100644
--- a/tests/testutils/python_repo.py
+++ b/tests/testutils/python_repo.py
@@ -1,9 +1,10 @@
import os
-import pytest
import re
import shutil
import subprocess
+import pytest
+
SETUP_TEMPLATE = '''\
from setuptools import setup
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py
index 12384e052..1455de264 100644
--- a/tests/testutils/repo/git.py
+++ b/tests/testutils/repo/git.py
@@ -1,8 +1,9 @@
import os
-import pytest
import shutil
import subprocess
+import pytest
+
from .repo import Repo
from .. import site
diff --git a/tests/testutils/repo/ostree.py b/tests/testutils/repo/ostree.py
index d4e50fea0..0bb1d8ae3 100644
--- a/tests/testutils/repo/ostree.py
+++ b/tests/testutils/repo/ostree.py
@@ -1,7 +1,8 @@
-import pytest
import subprocess
-from .repo import Repo
+import pytest
+
+from .repo import Repo
from .. import site