From fa2fb6bd38904e73e52c0bde2abb5de3914ff254 Mon Sep 17 00:00:00 2001 From: akoskaaa Date: Wed, 25 Mar 2015 23:15:34 -0700 Subject: [PATCH] [pep8] flake8 run for everything, fix items from this change Signed-off-by: akoskaaa --- script/test-versions | 2 +- tests/__init__.py | 4 ++-- tests/integration/service_test.py | 5 ++--- tests/unit/cli_test.py | 1 - tests/unit/config_test.py | 4 +++- tests/unit/progress_stream_test.py | 1 - tox.ini | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/script/test-versions b/script/test-versions index a9e3bc4c7a9..e5174200b18 100755 --- a/script/test-versions +++ b/script/test-versions @@ -8,7 +8,7 @@ set -e script/validate-dco >&2 echo "Running lint checks" -flake8 compose +flake8 if [ "$DOCKER_VERSIONS" == "" ]; then DOCKER_VERSIONS="1.5.0" diff --git a/tests/__init__.py b/tests/__init__.py index 68116d58eb6..08a7865e908 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ import sys if sys.version_info >= (2, 7): - import unittest + import unittest # NOQA else: - import unittest2 as unittest + import unittest2 as unittest # NOQA diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index 148ac4caf68..066f8b0957e 100644 --- a/tests/integration/service_test.py +++ b/tests/integration/service_test.py @@ -182,7 +182,7 @@ def test_recreate_containers_when_containers_are_stopped(self): entrypoint=['sleep'], command=['300'] ) - old_container = service.create_container() + service.create_container() self.assertEqual(len(service.containers(stopped=True)), 1) service.recreate_containers() self.assertEqual(len(service.containers(stopped=True)), 1) @@ -262,8 +262,7 @@ def test_start_container_with_external_links(self): set([ 'composetest_db_1', 'composetest_db_2', - 'db_3', - ]), + 'db_3']), ) def test_start_normal_container_does_not_create_links_to_its_own_service(self): diff --git a/tests/unit/cli_test.py b/tests/unit/cli_test.py index 2ed771f0257..fcb55a67313 100644 --- a/tests/unit/cli_test.py +++ b/tests/unit/cli_test.py @@ -8,7 +8,6 @@ import docker import mock -from six import StringIO from compose.cli import main from compose.cli.main import TopLevelCommand diff --git a/tests/unit/config_test.py b/tests/unit/config_test.py index 1eaeee203a8..8644d354b4b 100644 --- a/tests/unit/config_test.py +++ b/tests/unit/config_test.py @@ -234,7 +234,9 @@ def test_circular(self): def test_extends_validation(self): dictionary = {'extends': None} - load_config = lambda: config.make_service_dict('myweb', dictionary, working_dir='tests/fixtures/extends') + + def load_config(): + return config.make_service_dict('myweb', dictionary, working_dir='tests/fixtures/extends') self.assertRaisesRegexp(config.ConfigurationError, 'dictionary', load_config) diff --git a/tests/unit/progress_stream_test.py b/tests/unit/progress_stream_test.py index 694f120ed9d..142560681f3 100644 --- a/tests/unit/progress_stream_test.py +++ b/tests/unit/progress_stream_test.py @@ -2,7 +2,6 @@ from __future__ import absolute_import from tests import unittest -import mock from six import StringIO from compose import progress_stream diff --git a/tox.ini b/tox.ini index 6e83fc414d5..76a1b32979a 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ deps = -rrequirements-dev.txt commands = nosetests -v {posargs} - flake8 compose + flake8 [flake8] # ignore line-length for now