aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wick...@apache.org
Subject [2/4] Make style consistent with build-support/python/checkstyle-check
Date Thu, 05 Jun 2014 16:49:37 GMT
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_kill.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_kill.py b/src/test/python/apache/aurora/client/cli/test_kill.py
index 666ec3a..e9e1679 100644
--- a/src/test/python/apache/aurora/client/cli/test_kill.py
+++ b/src/test/python/apache/aurora/client/cli/test_kill.py
@@ -22,18 +22,9 @@ from apache.aurora.client.cli import EXIT_TIMEOUT
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.options import parse_instances
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
-from gen.apache.aurora.api.ttypes import (
-    AssignedTask,
-    Identity,
-    ScheduledTask,
-    ScheduleStatus,
-    ScheduleStatusResult,
-    TaskEvent,
-    TaskQuery
-)
+from gen.apache.aurora.api.ttypes import Identity, ScheduleStatus, ScheduleStatusResult, TaskQuery
 
 
 class TestInstancesParser(unittest.TestCase):
@@ -67,7 +58,6 @@ class TestClientKillCommand(AuroraClientCommandTest):
     return TaskQuery(taskIds=None, jobName=cls.TEST_JOB, environment=cls.TEST_ENV,
                      instanceIds=instance_ids, owner=Identity(role=cls.TEST_ROLE, user=None))
 
-
   def test_killall_job(self):
     """Test kill client-side API logic."""
     mock_context = FakeAuroraCommandContext()
@@ -87,7 +77,8 @@ class TestClientKillCommand(AuroraClientCommandTest):
         fp.write(self.get_valid_config())
         fp.flush()
         cmd = AuroraCommandLine()
-        cmd.execute(['job', 'killall', '--no-batching', '--config=%s' % fp.name, 'west/bozo/test/hello'])
+        cmd.execute(['job', 'killall', '--no-batching', '--config=%s' % fp.name,
+            'west/bozo/test/hello'])
 
       # Now check that the right API calls got made.
       assert api.kill_job.call_count == 1
@@ -123,7 +114,7 @@ class TestClientKillCommand(AuroraClientCommandTest):
       api.kill_job.assert_called_with(AuroraJobKey.from_path('west/bozo/test/hello'), None)
       self.assert_scheduler_called(api, self.get_expected_task_query(), 8)
 
-  def test_killall_job(self):
+  def test_killall_job_something_else(self):
     """Test kill client-side API logic."""
     mock_context = FakeAuroraCommandContext()
     mock_scheduler_proxy = Mock()
@@ -166,7 +157,8 @@ class TestClientKillCommand(AuroraClientCommandTest):
         fp.write(self.get_valid_config())
         fp.flush()
         cmd = AuroraCommandLine()
-        cmd.execute(['job', 'kill', '--config=%s' % fp.name, '--no-batching', 'west/bozo/test/hello/0,2,4-6'])
+        cmd.execute(['job', 'kill', '--config=%s' % fp.name, '--no-batching',
+            'west/bozo/test/hello/0,2,4-6'])
 
       # Now check that the right API calls got made.
       assert api.kill_job.call_count == 1
@@ -196,7 +188,6 @@ class TestClientKillCommand(AuroraClientCommandTest):
       # Now check that the right API calls got made.
       assert api.kill_job.call_count == 0
 
-
   def test_kill_job_with_invalid_instances_nonstrict(self):
     """Test kill client-side API logic."""
     mock_context = FakeAuroraCommandContext()
@@ -222,7 +213,6 @@ class TestClientKillCommand(AuroraClientCommandTest):
       api.kill_job.assert_called_with(AuroraJobKey.from_path('west/bozo/test/hello'), instances)
       self.assert_scheduler_called(api, self.get_expected_task_query(instances), 2)
 
-
   def test_kill_job_with_instances_batched(self):
     """Test kill client-side API logic."""
     mock_context = FakeAuroraCommandContext()
@@ -292,7 +282,8 @@ class TestClientKillCommand(AuroraClientCommandTest):
         fp.write(self.get_valid_config())
         fp.flush()
         cmd = AuroraCommandLine()
-        cmd.execute(['job', 'kill', '--max-total-failures=1', '--config=%s' % fp.name, 'west/bozo/test/hello/0,2,4-13'])
+        cmd.execute(['job', 'kill', '--max-total-failures=1', '--config=%s' % fp.name,
+            'west/bozo/test/hello/0,2,4-13'])
 
       # Now check that the right API calls got made. We should have aborted after the second batch.
       assert api.kill_job.call_count == 2
@@ -322,7 +313,6 @@ class TestClientKillCommand(AuroraClientCommandTest):
       # Now check that the right API calls got made.
       assert api.kill_job.call_count == 0
 
-
   def test_kill_job_with_instances_deep_api(self):
     """Test kill client-side API logic."""
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_open.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_open.py b/src/test/python/apache/aurora/client/cli/test_open.py
index 5557c35..c20649f 100644
--- a/src/test/python/apache/aurora/client/cli/test_open.py
+++ b/src/test/python/apache/aurora/client/cli/test_open.py
@@ -12,11 +12,9 @@
 # limitations under the License.
 #
 
-import contextlib
+from mock import patch
 
-from mock import Mock, patch
-
-from apache.aurora.client.cli import EXIT_INVALID_PARAMETER, EXIT_OK
+from apache.aurora.client.cli import EXIT_OK
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_plugins.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_plugins.py b/src/test/python/apache/aurora/client/cli/test_plugins.py
index 00b4583..ce85318 100644
--- a/src/test/python/apache/aurora/client/cli/test_plugins.py
+++ b/src/test/python/apache/aurora/client/cli/test_plugins.py
@@ -12,21 +12,13 @@
 # limitations under the License.
 #
 
-import contextlib
-
 from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
-from apache.aurora.client.cli import (
-    ConfigurationPlugin,
-    EXIT_COMMAND_FAILURE,
-    EXIT_INVALID_CONFIGURATION,
-    EXIT_OK
-)
+from apache.aurora.client.cli import ConfigurationPlugin, EXIT_OK
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.options import CommandOption
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.config import AuroraConfig
 
 from gen.apache.aurora.api.ttypes import (
@@ -53,10 +45,9 @@ class BogusPlugin(ConfigurationPlugin):
 
   def before_dispatch(self, args):
     if args[0] == '--bogus_bogus':
-       args = args[1:]
+      args = args[1:]
     return args
 
-
   def before_execution(self, context):
     context.bogosity = context.options.bogosity
 
@@ -64,9 +55,11 @@ class BogusPlugin(ConfigurationPlugin):
     context.after = True
     raise self.Error("Oops")
 
+
 class EmptyPlugin(ConfigurationPlugin):
   pass
 
+
 class TestPlugins(AuroraClientCommandTest):
 
   @classmethod
@@ -150,7 +143,7 @@ class TestPlugins(AuroraClientCommandTest):
       self.assert_scheduler_called(api, mock_query, 1)
       # Check that the plugin did its job.
       assert mock_context.bogosity == "maximum"
-      assert mock_context.after == True
+      assert mock_context.after
 
   def test_empty_plugins_in_create_job(self):
     """Installs a plugin that doesn't implement any of the plugin methods.
@@ -185,7 +178,6 @@ class TestPlugins(AuroraClientCommandTest):
     for str in str.split('\n'):
       self.err_transcript.append(str)
 
-
   def test_plugin_options_in_help(self):
     cmd = AuroraCommandLine()
     cmd.register_plugin(BogusPlugin())

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_restart.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_restart.py b/src/test/python/apache/aurora/client/cli/test_restart.py
index 50acc09..407eb41 100644
--- a/src/test/python/apache/aurora/client/cli/test_restart.py
+++ b/src/test/python/apache/aurora/client/cli/test_restart.py
@@ -22,14 +22,7 @@ from apache.aurora.client.cli import EXIT_API_ERROR, EXIT_INVALID_PARAMETER
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest
 
-from gen.apache.aurora.api.ttypes import (
-    AssignedTask,
-    JobKey,
-    PopulateJobResult,
-    ScheduledTask,
-    ScheduleStatusResult,
-    TaskConfig
-)
+from gen.apache.aurora.api.ttypes import JobKey, PopulateJobResult, TaskConfig
 
 
 class TestRestartCommand(AuroraClientCommandTest):
@@ -51,7 +44,6 @@ class TestRestartCommand(AuroraClientCommandTest):
     populate.result.populateJobResult.populated = set(configs)
     return populate
 
-
   @classmethod
   def setup_health_checks(cls, mock_api):
     mock_health_check = Mock(spec=StatusHealthCheck)
@@ -111,7 +103,6 @@ class TestRestartCommand(AuroraClientCommandTest):
         assert mock_scheduler_proxy.getTasksStatus.call_count == 0
         assert mock_scheduler_proxy.restartShards.call_count == 0
 
-
   def test_restart_failed_status(self):
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
     mock_health_check = self.setup_health_checks(mock_api)
@@ -139,7 +130,6 @@ class TestRestartCommand(AuroraClientCommandTest):
     self.setup_mock_scheduler_for_simple_restart(mock_api)
     # Make getTasksStatus return an error, which is what happens when a job is not found.
     mock_scheduler_proxy.getTasksStatus.return_value = self.create_error_response()
-    mock_logger = Mock()
     with contextlib.nested(
         patch('apache.aurora.client.cli.print_aurora_log'),
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
@@ -152,7 +142,8 @@ class TestRestartCommand(AuroraClientCommandTest):
         fp.write(self.get_valid_config())
         fp.flush()
         cmd = AuroraCommandLine()
-        result = cmd.execute(['job', 'restart', '--batch-size=5', 'west/bozo/test/hello/1-3', fp.name])
+        result = cmd.execute(['job', 'restart', '--batch-size=5', 'west/bozo/test/hello/1-3',
+            fp.name])
         # We need to check tat getTasksStatus was called, but that restartShards wasn't.
         # In older versions of the client, if shards were specified, but the job didn't
         # exist, the error wouldn't be detected unti0 restartShards was called, which generated

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_status.py b/src/test/python/apache/aurora/client/cli/test_status.py
index 4cc3f9d..dc1c730 100644
--- a/src/test/python/apache/aurora/client/cli/test_status.py
+++ b/src/test/python/apache/aurora/client/cli/test_status.py
@@ -14,7 +14,7 @@
 
 import contextlib
 
-from mock import call, Mock, patch
+from mock import Mock, patch
 
 from apache.aurora.client.cli import EXIT_INVALID_PARAMETER
 from apache.aurora.client.cli.client import AuroraCommandLine

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_task_run.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_task_run.py b/src/test/python/apache/aurora/client/cli/test_task_run.py
index 2663398..167f490 100644
--- a/src/test/python/apache/aurora/client/cli/test_task_run.py
+++ b/src/test/python/apache/aurora/client/cli/test_task_run.py
@@ -16,10 +16,8 @@ import contextlib
 
 from mock import Mock, patch
 
-from apache.aurora.client.cli import EXIT_INVALID_PARAMETER
 from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.common.aurora_job_key import AuroraJobKey
+from apache.aurora.client.cli.util import AuroraClientCommandTest
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -108,7 +106,8 @@ class TestRunCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
         patch('apache.aurora.client.cli.task.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('apache.aurora.client.api.command_runner.InstanceDistributedCommandRunner.sandbox_args',
+        patch('apache.aurora.client.api.command_runner.'
+              'InstanceDistributedCommandRunner.sandbox_args',
             return_value=sandbox_args),
         patch('subprocess.Popen', return_value=self.create_mock_process())) as (
             mock_scheduler_proxy_class,
@@ -134,6 +133,7 @@ class TestRunCommand(AuroraClientCommandTest):
           'slaverun/sandbox;ls'],
           stderr=-2, stdout=-1)
 
+
 class TestSshCommand(AuroraClientCommandTest):
   @classmethod
   def create_mock_scheduled_tasks(cls):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/test_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_update.py b/src/test/python/apache/aurora/client/cli/test_update.py
index a2abc5e..08be49e 100644
--- a/src/test/python/apache/aurora/client/cli/test_update.py
+++ b/src/test/python/apache/aurora/client/cli/test_update.py
@@ -180,8 +180,8 @@ class TestUpdateCommand(AuroraClientCommandTest):
   @classmethod
   def setup_quota_check(cls):
     mock_quota_check = Mock(spec=QuotaCheck)
-    mock_quota_check.validate_quota_from_requested.return_value = \
-        cls.create_simple_success_response()
+    mock_quota_check.validate_quota_from_requested.return_value = (
+        cls.create_simple_success_response())
     return mock_quota_check
 
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/cli/util.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/util.py b/src/test/python/apache/aurora/client/cli/util.py
index dac4928..070718c 100644
--- a/src/test/python/apache/aurora/client/cli/util.py
+++ b/src/test/python/apache/aurora/client/cli/util.py
@@ -91,6 +91,8 @@ class FakeAuroraCommandContext(AuroraCommandContext):
 
 
 class AuroraClientCommandTest(unittest.TestCase):
+  FAKE_TIME = 42131
+
   @classmethod
   def create_blank_response(cls, code, msg):
     response = Mock(spec=Response)
@@ -163,9 +165,6 @@ class AuroraClientCommandTest(unittest.TestCase):
     status_response = cls.create_status_call_result()
     scheduler.getTasksStatus.return_value = status_response
 
-
-  FAKE_TIME = 42131
-
   @classmethod
   def fake_time(cls, ignored):
     """Utility function used for faking time to speed up tests."""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_admin_sla.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_admin_sla.py b/src/test/python/apache/aurora/client/commands/test_admin_sla.py
index 84a91d5..da8015f 100644
--- a/src/test/python/apache/aurora/client/commands/test_admin_sla.py
+++ b/src/test/python/apache/aurora/client/commands/test_admin_sla.py
@@ -19,7 +19,7 @@ from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.api import AuroraClientAPI
-from apache.aurora.client.api.sla import DomainUpTimeSlaVector
+from apache.aurora.client.api.sla import DomainUpTimeSlaVector, JobUpTimeDetails, JobUpTimeLimit
 from apache.aurora.client.base import DEFAULT_GROUPING
 from apache.aurora.client.commands.admin import sla_list_safe_domain, sla_probe_hosts
 from apache.aurora.client.commands.util import AuroraClientCommandTest
@@ -55,7 +55,7 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
     for i in range(num_hosts):
       host_name = 'h%s' % i
       job = AuroraJobKey.from_path('west/role/env/job%s' % i)
-      hosts[host_name].append(DomainUpTimeSlaVector.JobUpTimeLimit(job, percentage, duration))
+      hosts[host_name].append(JobUpTimeLimit(job, percentage, duration))
     return [hosts]
 
   @classmethod
@@ -214,9 +214,8 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
         sla_list_safe_domain(['west', '50', '100s'])
 
         job_key = AuroraJobKey.from_path('west/role/env/job1')
-        override = {job_key: DomainUpTimeSlaVector.JobUpTimeLimit(job_key, 30, 200)}
-        mock_vector.get_safe_hosts.assert_called_once_with(50.0, 100.0,
-            override, DEFAULT_GROUPING)
+        override = {job_key: JobUpTimeLimit(job_key, 30, 200)}
+        mock_vector.get_safe_hosts.assert_called_once_with(50.0, 100.0, override, DEFAULT_GROUPING)
         mock_print_results.assert_called_once_with(['h0', 'h1', 'h2'])
 
   def test_safe_domain_list_jobs(self):
@@ -247,8 +246,7 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
   def test_safe_domain_invalid_percentage(self):
     """Tests execution of the sla_list_safe_domain command with invalid percentage"""
     mock_options = self.setup_mock_options()
-    with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
-
+    with patch('twitter.common.app.get_options', return_value=mock_options):
       try:
         sla_list_safe_domain(['west', '0', '100s'])
       except SystemExit:
@@ -262,7 +260,7 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
       fp.write('30 200s')
       fp.flush()
       mock_options = self.setup_mock_options(override=fp.name)
-      with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
+      with patch('twitter.common.app.get_options', return_value=mock_options):
 
         try:
           sla_list_safe_domain(['west', '50', '100s'])
@@ -274,7 +272,7 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
   def test_safe_domain_hosts_error(self):
     """Tests execution of the sla_list_safe_domain command with both include file and list"""
     mock_options = self.setup_mock_options(include='file', include_list='list')
-    with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
+    with patch('twitter.common.app.get_options', return_value=mock_options):
 
       try:
         sla_list_safe_domain(['west', '50', '100s'])
@@ -286,7 +284,7 @@ class TestAdminSlaListSafeDomainCommand(AuroraClientCommandTest):
   def test_safe_domain_grouping_error(self):
     """Tests execution of the sla_list_safe_domain command invalid grouping"""
     mock_options = self.setup_mock_options(grouping='foo')
-    with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
+    with patch('twitter.common.app.get_options', return_value=mock_options):
 
       try:
         sla_list_safe_domain(['west', '50', '100s'])
@@ -319,7 +317,7 @@ class TestAdminSlaProbeHostsCommand(AuroraClientCommandTest):
     for i in range(num_hosts):
       host_name = 'h%s' % i
       job = AuroraJobKey.from_path('west/role/env/job%s' % i)
-      hosts[host_name].append(DomainUpTimeSlaVector.JobUpTimeDetails(job, predicted, safe, safe_in))
+      hosts[host_name].append(JobUpTimeDetails(job, predicted, safe, safe_in))
     return [hosts]
 
   def test_probe_hosts_with_list(self):
@@ -385,7 +383,7 @@ class TestAdminSlaProbeHostsCommand(AuroraClientCommandTest):
       fp.write('h0')
       fp.flush()
       mock_options = self.setup_mock_options(hosts='h0', filename=fp.name)
-      with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
+      with patch('twitter.common.app.get_options', return_value=mock_options):
 
         try:
           sla_probe_hosts(['west', '50', '100s'])
@@ -397,7 +395,7 @@ class TestAdminSlaProbeHostsCommand(AuroraClientCommandTest):
   def test_probe_grouping_error(self):
     """Tests execution of the sla_probe_hosts command with invalid grouping."""
     mock_options = self.setup_mock_options(hosts='h0', grouping='foo')
-    with patch('twitter.common.app.get_options', return_value=mock_options) as (_):
+    with patch('twitter.common.app.get_options', return_value=mock_options):
 
       try:
         sla_probe_hosts(['west', '50', '100s'])

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_cancel_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_cancel_update.py b/src/test/python/apache/aurora/client/commands/test_cancel_update.py
index f8df6ae..5f05ef7 100644
--- a/src/test/python/apache/aurora/client/commands/test_cancel_update.py
+++ b/src/test/python/apache/aurora/client/commands/test_cancel_update.py
@@ -13,17 +13,13 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.commands.core import cancel_update
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     Identity,
@@ -84,7 +80,6 @@ class TestClientCancelUpdateCommand(AuroraClientCommandTest):
         AuroraJobKey(cls.TEST_CLUSTER, cls.TEST_ROLE, cls.TEST_ENV, cls.TEST_JOB),
         config=None)
 
-
   def test_simple_successful_cancel_update(self):
     """Run a test of the "kill" command against a mocked-out API:
     Verifies that the kill command sends the right API RPCs, and performs the correct

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_create.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_create.py b/src/test/python/apache/aurora/client/commands/test_create.py
index 75f0682..4cd1343 100644
--- a/src/test/python/apache/aurora/client/commands/test_create.py
+++ b/src/test/python/apache/aurora/client/commands/test_create.py
@@ -13,24 +13,18 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
 from pystachio.config import Config
-from twitter.common import app
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.commands.core import create
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.config import AuroraConfig
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
-    Response,
-    ResponseCode,
-    Result,
     ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_hooks.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_hooks.py b/src/test/python/apache/aurora/client/commands/test_hooks.py
index 7648bf4..0c76aea 100644
--- a/src/test/python/apache/aurora/client/commands/test_hooks.py
+++ b/src/test/python/apache/aurora/client/commands/test_hooks.py
@@ -13,11 +13,8 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
-from pystachio.config import Config
-from twitter.common import app
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.commands.core import create
@@ -28,9 +25,6 @@ from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
-    Response,
-    ResponseCode,
-    Result,
     ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
@@ -135,11 +129,10 @@ class TestClientCreateCommand(AuroraClientCommandTest):
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
     with contextlib.nested(
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('apache.aurora.client.api.SchedulerProxy', return_value = mock_scheduler_proxy),
+        patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('twitter.common.app.get_options', return_value=mock_options)):
 
-      mock_query = self.create_mock_query()
-      mock_scheduler_proxy.createJob.return_value=self.get_createjob_response()
+      mock_scheduler_proxy.createJob.return_value = self.get_createjob_response()
 
       mock_scheduler_proxy.getTasksStatus.side_effect = [
         self.create_mock_status_query_result(ScheduleStatus.INIT),
@@ -175,11 +168,10 @@ class TestClientCreateCommand(AuroraClientCommandTest):
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
     with contextlib.nested(
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('apache.aurora.client.api.SchedulerProxy', return_value = mock_scheduler_proxy),
+        patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('twitter.common.app.get_options', return_value=mock_options)):
 
-      mock_query = self.create_mock_query()
-      mock_scheduler_proxy.createJob.return_value=self.get_createjob_response()
+      mock_scheduler_proxy.createJob.return_value = self.get_createjob_response()
 
       mock_scheduler_proxy.getTasksStatus.side_effect = [
         self.create_mock_status_query_result(ScheduleStatus.INIT),
@@ -200,7 +192,6 @@ class TestClientCreateCommand(AuroraClientCommandTest):
       assert mock_scheduler_proxy.createJob.call_count == 0
       assert len(hook.created_jobs) == 1
 
-
   def test_block_hooks(self):
     """Run a test of the "create" command against a mocked API;
     verifies that a required hook runs, even though the config doesn't mention it.
@@ -213,19 +204,16 @@ class TestClientCreateCommand(AuroraClientCommandTest):
     GlobalHookRegistry.register_global_hook(hook)
     mock_options.disable_all_hooks_reason = "Because I said so."
 
-
     # create first calls get_job_config, which calls get_config. As long as we've got the options
     # set up correctly, this should work.
-
     # Next, create gets an API object via make_client. We need to replace that with a mock API.
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
     with contextlib.nested(
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('apache.aurora.client.api.SchedulerProxy', return_value = mock_scheduler_proxy),
+        patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('twitter.common.app.get_options', return_value=mock_options)):
 
-      mock_query = self.create_mock_query()
-      mock_scheduler_proxy.createJob.return_value=self.get_createjob_response()
+      mock_scheduler_proxy.createJob.return_value = self.get_createjob_response()
 
       mock_scheduler_proxy.getTasksStatus.side_effect = [
         self.create_mock_status_query_result(ScheduleStatus.INIT),

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_kill.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_kill.py b/src/test/python/apache/aurora/client/commands/test_kill.py
index 3e2ac1f..94bbe1b 100644
--- a/src/test/python/apache/aurora/client/commands/test_kill.py
+++ b/src/test/python/apache/aurora/client/commands/test_kill.py
@@ -13,17 +13,13 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.commands.core import kill, killall
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -61,20 +57,6 @@ class TestClientKillCommand(AuroraClientCommandTest):
     return mock_api_factory
 
   @classmethod
-  def create_mock_status_query_result(cls, scheduleStatus):
-    mock_query_result = Mock(spec=Response)
-    mock_query_result.result = Mock(spec=Result)
-    mock_query_result.result.scheduleStatusResult = Mock(spec=ScheduleStatusResult)
-    if scheduleStatus == ScheduleStatus.INIT:
-      # status query result for before job is launched.
-      mock_query_result.result.scheduleStatusResult.tasks = []
-    else:
-      mock_task_one = cls.create_mock_task('hello', 0, 1000, scheduleStatus)
-      mock_task_two = cls.create_mock_task('hello', 1, 1004, scheduleStatus)
-      mock_query_result.result.scheduleStatusResult.tasks = [mock_task_one, mock_task_two]
-    return mock_query_result
-
-  @classmethod
   def get_kill_job_response(cls):
     return cls.create_simple_success_response()
 
@@ -82,19 +64,11 @@ class TestClientKillCommand(AuroraClientCommandTest):
   def get_kill_job_error_response(cls):
     return cls.create_error_response()
 
-
   @classmethod
   def assert_kill_job_called(cls, mock_api):
     assert mock_api.kill_job.call_count == 1
 
   @classmethod
-  def get_expected_task_query(cls, instances=None):
-    """Helper to create the query that will be a parameter to job kill."""
-    instance_ids = frozenset(instances) if instances is not None else None
-    return TaskQuery(taskIds=None, jobName=cls.TEST_JOB, environment=cls.TEST_ENV,
-                     instanceIds=instance_ids, owner=Identity(role=cls.TEST_ROLE, user=None))
-
-  @classmethod
   def create_mock_task(cls, task_id, instance_id, initial_time, status):
     mock_task = Mock(spec=ScheduledTask)
     mock_task.assignedTask = Mock(spec=AssignedTask)
@@ -144,13 +118,9 @@ class TestClientKillCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
         patch('twitter.common.app.get_options', return_value=mock_options),
-        patch('apache.aurora.client.commands.core.get_job_config', return_value=mock_config)) as (
-      mock_sleep,
-      mock_api_patch,
-      mock_scheduler_proxy_class,
-      mock_clusters,
-      options,
-      mock_get_job_config):
+        patch('apache.aurora.client.commands.core.get_job_config', return_value=mock_config)
+    ) as (mock_sleep, mock_api_patch, mock_scheduler_proxy_class, mock_clusters, options,
+        mock_get_job_config):
 
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -408,17 +378,17 @@ class TestClientKillCommand(AuroraClientCommandTest):
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
     mock_api.check_status.return_value = self.create_status_call_result()
     mock_scheduler_proxy.getTasksStatus.return_value = self.create_status_call_result()
-    mock_api.kill_job.side_effect = [self.get_kill_job_error_response(), self.get_kill_job_response()]
+    mock_api.kill_job.side_effect = [
+        self.get_kill_job_error_response(), self.get_kill_job_response()]
     with contextlib.nested(
         patch('apache.aurora.client.factory.make_client', return_value=mock_api),
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
         patch('twitter.common.app.get_options', return_value=mock_options),
-        patch('apache.aurora.client.commands.core.get_job_config', return_value=mock_config)) as (
-            mock_api_factory_patch,
-            mock_scheduler_proxy_class,
-            mock_clusters,
-            options, mock_get_job_config):
+        patch('apache.aurora.client.commands.core.get_job_config', return_value=mock_config)
+    ) as (mock_api_factory_patch, mock_scheduler_proxy_class, mock_clusters, options,
+        mock_get_job_config):
+
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
         fp.flush()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_listjobs.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_listjobs.py b/src/test/python/apache/aurora/client/commands/test_listjobs.py
index 69dd6b4..f2a325e 100644
--- a/src/test/python/apache/aurora/client/commands/test_listjobs.py
+++ b/src/test/python/apache/aurora/client/commands/test_listjobs.py
@@ -13,14 +13,11 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
 
 from apache.aurora.client.commands.core import list_jobs
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import GetJobsResult, JobKey
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_restart.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_restart.py b/src/test/python/apache/aurora/client/commands/test_restart.py
index 6e0159f..0c6d5a0 100644
--- a/src/test/python/apache/aurora/client/commands/test_restart.py
+++ b/src/test/python/apache/aurora/client/commands/test_restart.py
@@ -37,9 +37,10 @@ class TestRestartCommand(AuroraClientCommandTest):
   @classmethod
   def setup_mock_options(cls):
     """set up to get a mock options object."""
-    mock_options = Mock(spec=['json', 'bindings', 'open_browser', 'shards', 'cluster',
-                              'health_check_interval_seconds', 'batch_size', 'max_per_shard_failures',
-                              'max_total_failures', 'restart_threshold', 'watch_secs'])
+    mock_options = Mock(
+        spec=['json', 'bindings', 'open_browser', 'shards', 'cluster',
+              'health_check_interval_seconds', 'batch_size', 'max_per_shard_failures',
+              'max_total_failures', 'restart_threshold', 'watch_secs'])
     mock_options.json = False
     mock_options.bindings = {}
     mock_options.open_browser = False

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_status.py b/src/test/python/apache/aurora/client/commands/test_status.py
index cb053d1..a5c0ef0 100644
--- a/src/test/python/apache/aurora/client/commands/test_status.py
+++ b/src/test/python/apache/aurora/client/commands/test_status.py
@@ -13,14 +13,11 @@
 #
 
 import contextlib
-import unittest
 
 from mock import Mock, patch
 
 from apache.aurora.client.commands.core import status
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -146,10 +143,8 @@ class TestListJobs(AuroraClientCommandTest):
     with contextlib.nested(
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('twitter.common.app.get_options', return_value=mock_options)) as (
-      mock_scheduler_proxy_class,
-      mock_clusters,
-      options):
+        patch('twitter.common.app.get_options', return_value=mock_options)
+    ) as (mock_scheduler_proxy_class, mock_clusters, options):
       status(['west/mchucarroll/test/hello'], mock_options)
 
       mock_scheduler_proxy.getTasksStatus.assert_called_with(TaskQuery(jobName='hello',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/commands/test_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_update.py b/src/test/python/apache/aurora/client/commands/test_update.py
index c5afbd3..ea8e092 100644
--- a/src/test/python/apache/aurora/client/commands/test_update.py
+++ b/src/test/python/apache/aurora/client/commands/test_update.py
@@ -14,7 +14,6 @@
 
 import contextlib
 import functools
-import unittest
 
 from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
@@ -25,9 +24,6 @@ from apache.aurora.client.api.quota_check import QuotaCheck
 from apache.aurora.client.api.updater import Updater
 from apache.aurora.client.commands.core import update
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 from apache.aurora.config import AuroraConfig
 
 from gen.apache.aurora.api.constants import ACTIVE_STATES
@@ -204,7 +200,8 @@ class TestUpdateCommand(AuroraClientCommandTest):
   @classmethod
   def setup_quota_check(cls):
     mock_quota_check = Mock(spec=QuotaCheck)
-    mock_quota_check.validate_quota_from_requested.return_value = cls.create_simple_success_response()
+    mock_quota_check.validate_quota_from_requested.return_value = (
+        cls.create_simple_success_response())
     return mock_quota_check
 
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/test_binding_helper.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/test_binding_helper.py b/src/test/python/apache/aurora/client/test_binding_helper.py
index cc9397b..ee00300 100644
--- a/src/test/python/apache/aurora/client/test_binding_helper.py
+++ b/src/test/python/apache/aurora/client/test_binding_helper.py
@@ -12,8 +12,6 @@
 # limitations under the License.
 #
 
-import textwrap
-
 from pystachio import Ref
 from pystachio.matcher import Any, Matcher
 from twitter.common.contextutil import temporary_file

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/client/test_config.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/test_config.py b/src/test/python/apache/aurora/client/test_config.py
index 4b3e149..901c337 100644
--- a/src/test/python/apache/aurora/client/test_config.py
+++ b/src/test/python/apache/aurora/client/test_config.py
@@ -19,9 +19,16 @@ from twitter.common.contextutil import temporary_dir, temporary_file
 
 from apache.aurora.client import config
 from apache.aurora.config import AuroraConfig
-from apache.aurora.config.schema.base import HealthCheckConfig, UpdateConfig
 from apache.aurora.config.loader import AuroraConfigLoader
-from apache.aurora.config.schema.base import Announcer, Job, MB, Resources, Task
+from apache.aurora.config.schema.base import (
+    Announcer,
+    HealthCheckConfig,
+    Job,
+    MB,
+    Resources,
+    Task,
+    UpdateConfig
+)
 
 from gen.apache.aurora.api.constants import DEFAULT_ENVIRONMENT
 
@@ -172,20 +179,22 @@ def test_update_config_passes_with_default_values():
 
   config._validate_update_config(AuroraConfig(base_job))
 
+
 def test_update_config_passes_with_min_requirement_values():
   base_job = Job(
     name='hello_world', role='john_doe', cluster='test-cluster',
-    update_config = UpdateConfig(watch_secs=26),
-    health_check_config = HealthCheckConfig(max_consecutive_failures=1),
+    update_config=UpdateConfig(watch_secs=26),
+    health_check_config=HealthCheckConfig(max_consecutive_failures=1),
     task=Task(name='main', processes=[],
               resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)))
 
   config._validate_update_config(AuroraConfig(base_job))
 
+
 def test_update_config_fails_insufficient_watch_secs_less_than_target():
   base_job = Job(
     name='hello_world', role='john_doe', cluster='test-cluster',
-    update_config = UpdateConfig(watch_secs=10),
+    update_config=UpdateConfig(watch_secs=10),
     task=Task(name='main', processes=[],
               resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)))
 
@@ -196,8 +205,8 @@ def test_update_config_fails_insufficient_watch_secs_less_than_target():
 def test_update_config_fails_insufficient_watch_secs_equal_to_target():
   base_job = Job(
     name='hello_world', role='john_doe', cluster='test-cluster',
-    update_config = UpdateConfig(watch_secs=25),
-    health_check_config = HealthCheckConfig(max_consecutive_failures=1),
+    update_config=UpdateConfig(watch_secs=25),
+    health_check_config=HealthCheckConfig(max_consecutive_failures=1),
     task=Task(name='main', processes=[],
               resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)))
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/common/test_cluster.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_cluster.py b/src/test/python/apache/aurora/common/test_cluster.py
index 8559dfc..1d9422e 100644
--- a/src/test/python/apache/aurora/common/test_cluster.py
+++ b/src/test/python/apache/aurora/common/test_cluster.py
@@ -20,15 +20,15 @@ from apache.aurora.common.cluster import Cluster
 
 def test_simple():
   class AudubonTrait(Cluster.Trait):
-    master_role = String
-    slave_role  = Default(String, 'slave')
-    version     = Required(Integer)
+    master_role = String  # noqa
+    slave_role  = Default(String, 'slave')  # noqa
+    version     = Required(Integer)  # noqa
 
-  west = Cluster(name = 'west',
-                 master_role = 'west.master',
-                 slave_role = 'west.slave',
-                 version = 10)
-  east = Cluster(name = 'east', version = 11)
+  west = Cluster(name='west',
+                 master_role='west.master',
+                 slave_role='west.slave',
+                 version=10)
+  east = Cluster(name='east', version=11)
 
   assert east.name == 'east'
   with pytest.raises(AttributeError):
@@ -39,4 +39,4 @@ def test_simple():
 
   with pytest.raises(TypeError):
     # requires version at least
-    Cluster(name = 'east').with_traits(AudubonTrait)
+    Cluster(name='east').with_traits(AudubonTrait)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/common/test_cluster_option.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_cluster_option.py b/src/test/python/apache/aurora/common/test_cluster_option.py
index af671ee..2213d8c 100644
--- a/src/test/python/apache/aurora/common/test_cluster_option.py
+++ b/src/test/python/apache/aurora/common/test_cluster_option.py
@@ -20,8 +20,8 @@ from apache.aurora.common.cluster_option import ClusterOption
 from apache.aurora.common.clusters import Clusters
 
 CLUSTER_LIST = Clusters((
-  Cluster(name = 'smf1'),
-  Cluster(name = 'smf1-test'),
+  Cluster(name='smf1'),
+  Cluster(name='smf1-test'),
 ))
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/common/test_clusters.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_clusters.py b/src/test/python/apache/aurora/common/test_clusters.py
index 2f5632f..45250e6 100644
--- a/src/test/python/apache/aurora/common/test_clusters.py
+++ b/src/test/python/apache/aurora/common/test_clusters.py
@@ -51,14 +51,13 @@ def validate_loaded_clusters(clusters):
     cluster = clusters[cluster_name]
     assert cluster.name == cluster_name
     assert cluster.dc == cluster_name
-    assert cluster.force_notunnel == False
+    assert cluster.force_notunnel is False
     assert cluster.slave_root == '/var/lib/mesos'
     assert cluster.slave_run_directory == 'latest'
     assert cluster.auth_mechanism == 'UNAUTHENTICATED'
   assert clusters['cluster1'].zk == 'zookeeper.cluster1.example.com'
 
 
-
 def test_load_json():
   with temporary_dir() as td:
     clusters_json = os.path.join(td, 'clusters.json')

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/common/test_http_signaler.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_http_signaler.py b/src/test/python/apache/aurora/common/test_http_signaler.py
index 6bac80a..f5f8419 100644
--- a/src/test/python/apache/aurora/common/test_http_signaler.py
+++ b/src/test/python/apache/aurora/common/test_http_signaler.py
@@ -69,7 +69,7 @@ class TestHttpSignaler(unittest.TestCase):
     self._mox.StubOutWithMock(urllib_request, 'urlopen')
     urllib_request.urlopen(
         'http://localhost:%s/health' % self.PORT, None, timeout=1.0).AndRaise(
-        SocketTimeout('Timed out'))
+            SocketTimeout('Timed out'))
 
     self._mox.ReplayAll()
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/common/test_shellify.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_shellify.py b/src/test/python/apache/aurora/common/test_shellify.py
index 6bdecb7..e569b63 100644
--- a/src/test/python/apache/aurora/common/test_shellify.py
+++ b/src/test/python/apache/aurora/common/test_shellify.py
@@ -32,8 +32,7 @@ def test_shellify():
           "hi": [0],
         },
       ]
-    }
-  , prefix="TEST_"))
+    }, prefix="TEST_"))
 
   assert set(dump) == set([
     "TEST_NUM=123",

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/config/test_base.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_base.py b/src/test/python/apache/aurora/config/test_base.py
index 72a711a..66480db 100644
--- a/src/test/python/apache/aurora/config/test_base.py
+++ b/src/test/python/apache/aurora/config/test_base.py
@@ -16,17 +16,7 @@ import pytest
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.config import AuroraConfig, PortResolver
-from apache.aurora.config.schema.base import (
-    Announcer,
-    Empty,
-    Integer,
-    Job,
-    Process,
-    Resources,
-    Task
-)
-
-from gen.apache.aurora.api.ttypes import Identity
+from apache.aurora.config.schema.base import Announcer, Empty, Job, Process, Resources, Task
 
 resolve = PortResolver.resolve
 
@@ -56,7 +46,6 @@ def test_cycle():
     resolve(portmap)
 
 
-
 MESOS_CONFIG = """
 HELLO_WORLD = Job(
   name = 'hello_world',
@@ -72,6 +61,7 @@ HELLO_WORLD = Job(
 jobs = [HELLO_WORLD]
 """
 
+
 LIMITED_MESOS_CONFIG = """
 HELLO_WORLD = Job(
   name = 'hello_world',
@@ -96,33 +86,31 @@ jobs = [HELLO_WORLD]
 
 
 REIFIED_CONFIG = Job(
-  name = 'hello_world',
-  role = 'john_doe',
-  environment = 'staging42',
-  cluster = 'smf1-test',
-  task = Task(
-    name = 'main',
-    processes = [Process(name = 'hello_world', cmdline = 'echo {{mesos.instance}}')],
-    resources = Resources(cpu = 0.1, ram = 64 * 1048576, disk = 64 * 1048576),
+  name='hello_world',
+  role='john_doe',
+  environment='staging42',
+  cluster='smf1-test',
+  task=Task(
+    name='main',
+    processes=[Process(name='hello_world', cmdline='echo {{mesos.instance}}')],
+    resources=Resources(cpu=0.1, ram=64 * 1048576, disk=64 * 1048576),
   )
 )
 
 REIFIED_LIMITED_CONFIG = Job(
-  name = 'hello_world',
-  role = 'john_doe',
-  environment = 'staging42',
-  cluster = 'smf1-test',
-  task = Task(
-    name = 'main',
-    processes = [Process(name = 'hello_world_fails_0', cmdline = 'echo hello world',
-                         max_failures = 0),
-                 Process(name = 'hello_world_fails_50', cmdline = 'echo hello world',
-                         max_failures = 50),
-                 Process(name = 'hello_world_fails_100', cmdline = 'echo hello world',
-                         max_failures = 100),
-                 Process(name = 'hello_world_fails_200', cmdline = 'echo hello world',
-                         max_failures = 200)],
-    resources = Resources(cpu = 0.1, ram = 64 * 1048576, disk = 64 * 1048576),
+  name='hello_world',
+  role='john_doe',
+  environment='staging42',
+  cluster='smf1-test',
+  task=Task(
+    name='main',
+    processes=[
+        Process(name='hello_world_fails_0', cmdline='echo hello world', max_failures=0),
+        Process(name='hello_world_fails_50', cmdline='echo hello world', max_failures=50),
+        Process(name='hello_world_fails_100', cmdline='echo hello world', max_failures=100),
+        Process(name='hello_world_fails_200', cmdline='echo hello world', max_failures=200)
+    ],
+    resources=Resources(cpu=0.1, ram=64 * 1048576, disk=64 * 1048576),
   )
 )
 
@@ -165,27 +153,33 @@ def test_simple_config():
 
 
 def make_config(announce, *ports):
-  process = Process(name = 'hello',
-                    cmdline = ' '.join('{{thermos.ports[%s]}}' % port for port in ports))
+  process = Process(
+      name='hello',
+      cmdline=' '.join('{{thermos.ports[%s]}}' % port for port in ports))
   return AuroraConfig(Job(
-      name = 'hello_world', environment = 'staging42', role = 'john_doe', cluster = 'smf1-test',
-      announce = announce,
-      task = Task(name = 'main', processes = [process],
-                  resources =  Resources(cpu = 0.1, ram = 64 * 1048576, disk = 64 * 1048576))))
+      name='hello_world',
+      environment='staging42',
+      role='john_doe',
+      cluster='smf1-test',
+      announce=announce,
+      task=Task(
+          name='main',
+          processes=[process],
+          resources=Resources(cpu=0.1, ram=64 * 1048576, disk=64 * 1048576))))
 
 
 def test_ports():
-  announce = Announcer(portmap = {'http': 80})
+  announce = Announcer(portmap={'http': 80})
   assert make_config(announce).ports() == set()
   assert make_config(announce, 'http').ports() == set()
   assert make_config(announce, 'http', 'thrift').ports() == set(['thrift'])
 
-  announce = Announcer(portmap = {'http': 'aurora'})
+  announce = Announcer(portmap={'http': 'aurora'})
   assert make_config(announce).ports() == set(['aurora'])
   assert make_config(announce, 'http').ports() == set(['aurora'])
   assert make_config(announce, 'http', 'thrift').ports() == set(['thrift', 'aurora'])
 
-  announce = Announcer(portmap = {'aurora': 'http'})
+  announce = Announcer(portmap={'aurora': 'http'})
   assert make_config(announce).ports() == set(['http'])
   assert make_config(announce, 'http').ports() == set(['http'])
   assert make_config(announce, 'http', 'thrift').ports() == set(['http', 'thrift'])
@@ -196,8 +190,8 @@ def test_ports():
 
 
 def test_static_port_aliasing():
-  announce = Announcer(primary_port = 'thrift',
-                       portmap = {'thrift': 8081, 'health': 8300, 'aurora': 'health'})
+  announce = Announcer(primary_port='thrift',
+                       portmap={'thrift': 8081, 'health': 8300, 'aurora': 'health'})
   assert make_config(announce).ports() == set()
   assert make_config(announce).job().taskConfig.requestedPorts == set()
   assert make_config(announce, 'thrift').ports() == set()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/config/test_constraint_parsing.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_constraint_parsing.py b/src/test/python/apache/aurora/config/test_constraint_parsing.py
index 385f6a3..fac8436 100644
--- a/src/test/python/apache/aurora/config/test_constraint_parsing.py
+++ b/src/test/python/apache/aurora/config/test_constraint_parsing.py
@@ -12,8 +12,6 @@
 # limitations under the License.
 #
 
-import unittest
-
 import pytest
 
 from apache.aurora.config.thrift import constraints_to_thrift
@@ -25,7 +23,7 @@ def test_parsing_constraints():
   }
   c = constraints_to_thrift(constraints_dict).pop()
   assert c.name == 'int'
-  assert c.constraint.value.negated == False
+  assert c.constraint.value.negated is False
   assert c.constraint.value.values == set(['2'])
 
   # Test negated value
@@ -34,7 +32,7 @@ def test_parsing_constraints():
   }
   c = constraints_to_thrift(constraints_dict).pop()
   assert c.name == '!str'
-  assert c.constraint.value.negated == True
+  assert c.constraint.value.negated
   assert c.constraint.value.values == set(['foo'])
 
   # Test list
@@ -43,7 +41,7 @@ def test_parsing_constraints():
   }
   c = constraints_to_thrift(constraints_dict).pop()
   assert c.name == 'set'
-  assert c.constraint.value.negated == False
+  assert c.constraint.value.negated is False
   assert c.constraint.value.values == set(['1', '2', '3', 'a', 'b', 'c'])
 
   constraints_dict = {
@@ -51,7 +49,7 @@ def test_parsing_constraints():
   }
   c = constraints_to_thrift(constraints_dict).pop()
   assert c.name == '!set'
-  assert c.constraint.value.negated == True
+  assert c.constraint.value.negated
   assert c.constraint.value.values == set(['1', '2', '3', 'a', 'b', 'c'])
 
   # Test limit
@@ -66,4 +64,4 @@ def test_parsing_constraints():
     'limit': 'limit:a',
   }
   with pytest.raises(ValueError):
-    constraints = constraints_to_thrift(constraints_dict)
+    constraints_to_thrift(constraints_dict)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/config/test_loader.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_loader.py b/src/test/python/apache/aurora/config/test_loader.py
index adde41b..00b6eab 100644
--- a/src/test/python/apache/aurora/config/test_loader.py
+++ b/src/test/python/apache/aurora/config/test_loader.py
@@ -16,18 +16,17 @@ import json
 import tempfile
 
 import pytest
-from pystachio import Environment
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.config import AuroraConfig
 from apache.aurora.config.loader import AuroraConfigLoader
-from apache.thermos.config.loader import ThermosTaskWrapper
 
 
 BAD_MESOS_CONFIG = """
 3 2 1 3 2 4 2 3
 """
 
+
 MESOS_CONFIG = """
 HELLO_WORLD = MesosJob(
   name = 'hello_world',
@@ -42,6 +41,7 @@ HELLO_WORLD = MesosJob(
 jobs = [HELLO_WORLD]
 """
 
+
 def test_enoent():
   nonexistent_file = tempfile.mktemp()
   with pytest.raises(AuroraConfigLoader.NotFound):
@@ -97,6 +97,6 @@ def test_pick():
   hello_world = env['jobs'][0]
   assert AuroraConfig.pick(env, 'hello_world', None) == hello_world
 
-  env['jobs'][0] = env['jobs'][0](name = 'something_{{else}}')
+  env['jobs'][0] = env['jobs'][0](name='something_{{else}}')
   assert str(AuroraConfig.pick(env, 'something_else', [{'else': 'else'}]).name()) == (
       'something_else')

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/config/test_thrift.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_thrift.py b/src/test/python/apache/aurora/config/test_thrift.py
index 9fea33d..fd28313 100644
--- a/src/test/python/apache/aurora/config/test_thrift.py
+++ b/src/test/python/apache/aurora/config/test_thrift.py
@@ -30,14 +30,14 @@ from gen.apache.aurora.api.ttypes import CronCollisionPolicy, Identity, JobKey
 from gen.apache.aurora.test.constants import INVALID_IDENTIFIERS, VALID_IDENTIFIERS
 
 HELLO_WORLD = Job(
-  name = 'hello_world',
-  role = 'john_doe',
-  environment = 'staging66',
-  cluster = 'smf1-test',
-  task = Task(
-    name = 'main',
-    processes = [Process(name = 'hello_world', cmdline = 'echo {{mesos.instance}}')],
-    resources = Resources(cpu = 0.1, ram = 64 * 1048576, disk = 64 * 1048576),
+  name='hello_world',
+  role='john_doe',
+  environment='staging66',
+  cluster='smf1-test',
+  task=Task(
+    name='main',
+    processes=[Process(name='hello_world', cmdline='echo {{mesos.instance}}')],
+    resources=Resources(cpu=0.1, ram=64 * 1048576, disk=64 * 1048576),
   )
 )
 
@@ -51,14 +51,14 @@ def test_simple_config():
     environment=HELLO_WORLD.environment().get(),
     name=HELLO_WORLD.name().get())
   assert job.owner == Identity(role=HELLO_WORLD.role().get(), user=getpass.getuser())
-  assert job.cronSchedule == None
+  assert job.cronSchedule is None
   assert tti.jobName == 'hello_world'
-  assert tti.isService == False
+  assert tti.isService is False
   assert tti.numCpus == 0.1
   assert tti.ramMb == 64
   assert tti.diskMb == 64
   assert tti.requestedPorts == set()
-  assert tti.production == False
+  assert tti.production is False
   assert tti.priority == 0
   assert tti.maxTaskFailures == 1
   assert tti.constraints == set()
@@ -68,23 +68,23 @@ def test_simple_config():
 
 def test_config_with_options():
   hwc = HELLO_WORLD(
-    production = True,
-    priority = 200,
-    service = True,
-    cron_policy = 'RUN_OVERLAP',
-    constraints = {
-      'dedicated': 'your_mom',
+    production=True,
+    priority=200,
+    service=True,
+    cron_policy='RUN_OVERLAP',
+    constraints={
+      'dedicated': 'root',
       'cpu': 'x86_64'
     },
-    environment = 'prod'
+    environment='prod'
   )
   job = convert_pystachio_to_thrift(hwc)
   assert job.instanceCount == 1
   tti = job.taskConfig
 
-  assert tti.production == True
+  assert tti.production
   assert tti.priority == 200
-  assert tti.isService == True
+  assert tti.isService
   assert job.cronCollisionPolicy == CronCollisionPolicy.RUN_OVERLAP
   assert len(tti.constraints) == 2
   assert tti.environment == 'prod'
@@ -93,10 +93,10 @@ def test_config_with_options():
 
 def test_config_with_ports():
   hwc = HELLO_WORLD(
-    task = HELLO_WORLD.task()(
-      processes = [
-        Process(name = 'hello_world',
-                cmdline = 'echo {{thermos.ports[http]}} {{thermos.ports[admin]}}')
+    task=HELLO_WORLD.task()(
+      processes=[
+        Process(name='hello_world',
+                cmdline='echo {{thermos.ports[http]}} {{thermos.ports[admin]}}')
       ]
     )
   )
@@ -112,23 +112,23 @@ def test_config_with_bad_resources():
   convert_pystachio_to_thrift(HELLO_WORLD)
 
   good_resources = [
-    Resources(cpu = 1.0, ram = 1 * MB, disk = 1 * MB)
+    Resources(cpu=1.0, ram=1 * MB, disk=1 * MB)
   ]
 
   bad_resources = [
-    Resources(cpu = 0, ram = 1 * MB, disk = 1 * MB),
-    Resources(cpu = 1, ram = 0 * MB, disk = 1 * MB),
-    Resources(cpu = 1, ram = 1 * MB, disk = 0 * MB),
-    Resources(cpu = 1, ram = 1 * MB - 1, disk = 1 * MB),
-    Resources(cpu = 1, ram = 1 * MB, disk = 1 * MB - 1)
+    Resources(cpu=0, ram=1 * MB, disk=1 * MB),
+    Resources(cpu=1, ram=0 * MB, disk=1 * MB),
+    Resources(cpu=1, ram=1 * MB, disk=0 * MB),
+    Resources(cpu=1, ram=1 * MB - 1, disk=1 * MB),
+    Resources(cpu=1, ram=1 * MB, disk=1 * MB - 1)
   ]
 
   for resource in good_resources:
-    convert_pystachio_to_thrift(HELLO_WORLD(task = hwtask(resources = resource)))
+    convert_pystachio_to_thrift(HELLO_WORLD(task=hwtask(resources=resource)))
 
   for resource in bad_resources:
     with pytest.raises(ValueError):
-      convert_pystachio_to_thrift(HELLO_WORLD(task = hwtask(resources = resource)))
+      convert_pystachio_to_thrift(HELLO_WORLD(task=hwtask(resources=resource)))
 
 
 def test_config_with_task_links():
@@ -141,7 +141,7 @@ def test_config_with_task_links():
     'foo': 'http://%host%:%port:foo%',
     'bar': 'http://%host%:%port:bar%/%shard_id%'
   }
-  aurora_config = AuroraConfig(HELLO_WORLD(task_links = tl(unresolved_tl)))
+  aurora_config = AuroraConfig(HELLO_WORLD(task_links=tl(unresolved_tl)))
   assert aurora_config.task_links() == tl(resolved_tl)
   assert aurora_config.job().taskConfig.taskLinks == frozendict(resolved_tl)
 
@@ -154,12 +154,12 @@ def test_config_with_task_links():
 
 def test_unbound_references():
   def job_command(cmdline):
-    return AuroraConfig(HELLO_WORLD(task = SimpleTask('hello_world', cmdline))).raw()
+    return AuroraConfig(HELLO_WORLD(task=SimpleTask('hello_world', cmdline))).raw()
 
   # bindingless and bad => good bindings should work
   convert_pystachio_to_thrift(job_command('echo hello world'))
   convert_pystachio_to_thrift(job_command('echo {{mesos.user}}')
-      .bind(mesos = {'user': '{{mesos.role}}'}))
+      .bind(mesos={'user': '{{mesos.role}}'}))
 
   # unbound
   with pytest.raises(InvalidConfig):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py b/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py
index 4d62cf9..a80c6ef 100644
--- a/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py
+++ b/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py
@@ -18,7 +18,7 @@ import mock
 import pytest
 from twitter.common.contextutil import temporary_dir
 
-from apache.aurora.executor.common.sandbox import DirectorySandbox, SandboxInterface
+from apache.aurora.executor.common.sandbox import DirectorySandbox
 
 
 def test_directory_sandbox():

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/common/test_health_checker.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/common/test_health_checker.py b/src/test/python/apache/aurora/executor/common/test_health_checker.py
index 4071b40..baeaba2 100644
--- a/src/test/python/apache/aurora/executor/common/test_health_checker.py
+++ b/src/test/python/apache/aurora/executor/common/test_health_checker.py
@@ -24,6 +24,7 @@ from apache.aurora.executor.common.health_checker import HealthCheckerThread
 def thread_yield():
   time.sleep(0.1)
 
+
 class TestHealthChecker(unittest.TestCase):
   def setUp(self):
     self._clock = ThreadedClock()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/common/test_task_info.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/common/test_task_info.py b/src/test/python/apache/aurora/executor/common/test_task_info.py
index 394ee71..344fd67 100644
--- a/src/test/python/apache/aurora/executor/common/test_task_info.py
+++ b/src/test/python/apache/aurora/executor/common/test_task_info.py
@@ -26,25 +26,26 @@ from apache.aurora.executor.common.task_info import mesos_task_instance_from_ass
 
 from gen.apache.aurora.api.ttypes import AssignedTask, ExecutorConfig, TaskConfig
 
-BASE_MTI = MesosTaskInstance(instance = 0, role = getpass.getuser())
-BASE_TASK = Task(resources = Resources(cpu=1.0, ram=16*MB, disk=32*MB))
+BASE_MTI = MesosTaskInstance(instance=0, role=getpass.getuser())
+BASE_TASK = Task(resources=Resources(cpu=1.0, ram=16 * MB, disk=32 * MB))
 
 HELLO_WORLD_TASK_ID = 'hello_world-001'
 HELLO_WORLD = BASE_TASK(
-    name = 'hello_world',
-    processes = [Process(name = 'hello_world_{{thermos.task_id}}', cmdline = 'echo hello world')])
+    name='hello_world',
+    processes=[Process(name='hello_world_{{thermos.task_id}}', cmdline='echo hello world')])
 HELLO_WORLD_MTI = BASE_MTI(task=HELLO_WORLD)
 
-SLEEP60 = BASE_TASK(processes = [Process(name = 'sleep60', cmdline = 'sleep 60')])
-SLEEP2 = BASE_TASK(processes = [Process(name = 'sleep2', cmdline = 'sleep 2')])
+SLEEP60 = BASE_TASK(processes=[Process(name='sleep60', cmdline='sleep 60')])
+SLEEP2 = BASE_TASK(processes=[Process(name='sleep2', cmdline='sleep 2')])
 SLEEP60_MTI = BASE_MTI(task=SLEEP60)
 
 MESOS_JOB = MesosJob(
-  name = 'does_not_matter',
-  instances = 1,
-  role = getpass.getuser(),
+  name='does_not_matter',
+  instances=1,
+  role=getpass.getuser(),
 )
 
+
 def test_deserialize_thermos_task():
   task_config = TaskConfig(
       executorConfig=ExecutorConfig(name='thermos', data=MESOS_JOB(task=HELLO_WORLD).json_dumps()))

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/test_executor_vars.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/test_executor_vars.py b/src/test/python/apache/aurora/executor/test_executor_vars.py
index b35387f..af1c7b7 100644
--- a/src/test/python/apache/aurora/executor/test_executor_vars.py
+++ b/src/test/python/apache/aurora/executor/test_executor_vars.py
@@ -43,7 +43,7 @@ def test_extract_pexinfo():
 
 def test_init():
   self = ExecutorVars()
-  assert self._orphan == False
+  assert self._orphan is False
   samples = self.metrics.sample()
   assert samples['version'] == 'UNKNOWN'
   assert samples['orphan'] == 0

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/test_gc_executor.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/test_gc_executor.py b/src/test/python/apache/aurora/executor/test_gc_executor.py
index e98bffa..0b2278a 100644
--- a/src/test/python/apache/aurora/executor/test_gc_executor.py
+++ b/src/test/python/apache/aurora/executor/test_gc_executor.py
@@ -105,10 +105,10 @@ class ProxyDriver(object):
   def stop(self):
     self.stopped.set()
 
-  def sendStatusUpdate(self, update):
+  def sendStatusUpdate(self, update):  # noqa
     self.updates.append(StatusUpdate(update.state, update.task_id.value))
 
-  def sendFrameworkMessage(self, message):
+  def sendFrameworkMessage(self, message):  # noqa
     self.messages.append(thrift_deserialize(SchedulerMessage(), message))
 
 
@@ -261,6 +261,7 @@ def test_state_reconciliation_terminal_active():
     assert tgc.len_results == (0, 0, 0, 0)
     assert llen(lgc, rgc, updates) == (0, 0, 1)
 
+
 def test_state_reconciliation_corrupt_tasks():
   for st0, st1 in product(THERMOS_TERMINALS, LIVE_STATES):
     tgc, driver = make_pair({}, {'foo': st0}, corrupt_tasks=['foo'])
@@ -268,6 +269,7 @@ def test_state_reconciliation_corrupt_tasks():
     assert tgc.len_results == (0, 0, 0, 0)
     assert llen(lgc, rgc, updates) == (1, 0, 0)
 
+
 def test_state_reconciliation_terminal_nexist():
   for st0, st1 in product(THERMOS_TERMINALS, LIVE_STATES):
     tgc, driver = make_pair({}, {'foo': st0})
@@ -329,8 +331,8 @@ def run_gc_with(active_executors, retained_tasks, lose=False):
     assert len(executor._gc_task_queue) == 0
     assert not executor._task_id
   assert len(proxy_driver.updates) >= 1
-  if not lose: # if the task is lost it will be cleaned out of band (by clean_orphans),
-               # so we don't care when the GC task actually finishes
+  if not lose:  # if the task is lost it will be cleaned out of band (by clean_orphans),
+                # so we don't care when the GC task actually finishes
     assert proxy_driver.updates[-1][0] == mesos.TASK_FINISHED
     assert proxy_driver.updates[-1][1] == TASK_ID
   return executor, proxy_driver
@@ -563,8 +565,9 @@ class TestRealGC(unittest.TestCase):
   """
     Test functions against the actual garbage_collect() functionality of the GC executor
   """
+
   def setUp(self):
-    self.HELLO_WORLD= SimpleTask(name="foo", command="echo hello world")
+    self.HELLO_WORLD = SimpleTask(name="foo", command="echo hello world")
 
   def setup_task(self, task, root, finished=False, corrupt=False):
     """Set up the checkpoint stream for the given task in the given checkpoint root, optionally
@@ -590,15 +593,28 @@ class TestRealGC(unittest.TestCase):
   def run_gc(self, root, task_id, retain=False):
     """Run the garbage collection process against the given task_id in the given checkpoint root"""
     class FakeTaskKiller(object):
-      def __init__(self, task_id, checkpoint_root): pass
-      def kill(self): pass
-      def lose(self): pass
+      def __init__(self, task_id, checkpoint_root):
+        pass
+
+      def kill(self):
+        pass
+
+      def lose(self):
+        pass
+
     class FakeTaskGarbageCollector(object):
-      def __init__(self, root): pass
-      def erase_logs(self, task_id): pass
-      def erase_metadata(self, task_id): pass
+      def __init__(self, root):
+        pass
+
+      def erase_logs(self, task_id):
+        pass
+
+      def erase_metadata(self, task_id):
+        pass
+
     class FastThermosGCExecutor(ThermosGCExecutor):
       POLL_WAIT = Amount(1, Time.MICROSECONDS)
+
     detector = functools.partial(FakeExecutorDetector, task_id) if retain else FakeExecutorDetector
     executor = FastThermosGCExecutor(
         checkpoint_root=root,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/aurora/executor/test_thermos_executor.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/test_thermos_executor.py b/src/test/python/apache/aurora/executor/test_thermos_executor.py
index b28fc32..55747a1 100644
--- a/src/test/python/apache/aurora/executor/test_thermos_executor.py
+++ b/src/test/python/apache/aurora/executor/test_thermos_executor.py
@@ -147,23 +147,23 @@ def make_task(thermos_config, assigned_ports={}, **kw):
   return td
 
 
-BASE_MTI = MesosTaskInstance(instance = 0, role = getpass.getuser())
-BASE_TASK = Task(resources = Resources(cpu=1.0, ram=16*MB, disk=32*MB))
+BASE_MTI = MesosTaskInstance(instance=0, role=getpass.getuser())
+BASE_TASK = Task(resources=Resources(cpu=1.0, ram=16 * MB, disk=32 * MB))
 
 HELLO_WORLD_TASK_ID = 'hello_world-001'
 HELLO_WORLD = BASE_TASK(
-    name = 'hello_world',
-    processes = [Process(name = 'hello_world_{{thermos.task_id}}', cmdline = 'echo hello world')])
+    name='hello_world',
+    processes=[Process(name='hello_world_{{thermos.task_id}}', cmdline='echo hello world')])
 HELLO_WORLD_MTI = BASE_MTI(task=HELLO_WORLD)
 
-SLEEP60 = BASE_TASK(processes = [Process(name = 'sleep60', cmdline = 'sleep 60')])
-SLEEP2 = BASE_TASK(processes = [Process(name = 'sleep2', cmdline = 'sleep 2')])
+SLEEP60 = BASE_TASK(processes=[Process(name='sleep60', cmdline='sleep 60')])
+SLEEP2 = BASE_TASK(processes=[Process(name='sleep2', cmdline='sleep 2')])
 SLEEP60_MTI = BASE_MTI(task=SLEEP60)
 
 MESOS_JOB = MesosJob(
-  name = 'does_not_matter',
-  instances = 1,
-  role = getpass.getuser(),
+  name='does_not_matter',
+  instances=1,
+  role=getpass.getuser(),
 )
 
 
@@ -244,12 +244,15 @@ class SignalServer(ExceptionalThread):
     super(SignalServer, self).__init__()
     self.daemon = True
     self._stop = threading.Event()
+
   def run(self):
     while not self._stop.is_set():
       self._server.handle_request()
+
   def __enter__(self):
     self.start()
     return self._server.server_port
+
   def __exit__(self, exc_type, exc_val, traceback):
     self._stop.set()
 
@@ -350,7 +353,7 @@ class TestThermosExecutor(object):
     assert len(updates) == 3
     assert updates[-1][0][0].state == mesos_pb.TASK_KILLED
 
-  def test_killTask(self):
+  def test_killTask(self):  # noqa
     proxy_driver = ProxyDriver()
 
     with temporary_dir() as checkpoint_root:
@@ -393,12 +396,13 @@ class TestThermosExecutor(object):
     with SignalServer(UnhealthyHandler) as port:
       with temporary_dir() as checkpoint_root:
         health_check_config = HealthCheckConfig(initial_interval_secs=0.1, interval_secs=0.1)
-        _, executor = make_executor(proxy_driver,
-                                    checkpoint_root,
-                                    MESOS_JOB(task=SLEEP60, health_check_config=health_check_config),
-                                    ports={'health': port},
-                                    fast_status=True,
-                                    status_providers=(HealthCheckerProvider(),))
+        _, executor = make_executor(
+            proxy_driver,
+            checkpoint_root,
+            MESOS_JOB(task=SLEEP60, health_check_config=health_check_config),
+            ports={'health': port},
+            fast_status=True,
+            status_providers=(HealthCheckerProvider(),))
         executor.terminated.wait()
 
     updates = proxy_driver.method_calls['sendStatusUpdate']
@@ -468,7 +472,7 @@ class TestThermosExecutor(object):
 
       te._sandbox._init_start.set()
 
-  def test_killTask_during_runner_initialize(self):
+  def test_killTask_during_runner_initialize(self):  # noqa
     proxy_driver = ProxyDriver()
 
     task = make_task(HELLO_WORLD_MTI)
@@ -500,7 +504,7 @@ class TestThermosExecutor(object):
       assert len(updates) == 2
       assert updates[-1][0][0].state == mesos_pb.TASK_KILLED
 
-  def test_launchTask_deserialization_fail(self):
+  def test_launchTask_deserialization_fail(self):  # noqa
     proxy_driver = ProxyDriver()
 
     role = getpass.getuser()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/bin/test_thermos.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/bin/test_thermos.py b/src/test/python/apache/thermos/bin/test_thermos.py
index 67fa90b..2d9d333 100644
--- a/src/test/python/apache/thermos/bin/test_thermos.py
+++ b/src/test/python/apache/thermos/bin/test_thermos.py
@@ -12,4 +12,4 @@
 # limitations under the License.
 #
 
-from apache.thermos.bin import thermos
+from apache.thermos.bin import thermos  # noqa

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/common/test_planner.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/common/test_planner.py b/src/test/python/apache/thermos/common/test_planner.py
index f8cf49b..b58b5bf 100644
--- a/src/test/python/apache/thermos/common/test_planner.py
+++ b/src/test/python/apache/thermos/common/test_planner.py
@@ -20,11 +20,14 @@ from apache.thermos.common.planner import Planner
 def details(planner):
   return planner.runnable, planner.running, planner.finished
 
-def _(*processes):
+
+def _(*processes):  # noqa
   return set(processes)
 
+
 empty = set()
 
+
 def test_planner_empty():
   p = Planner(set(), {})
   assert details(p) == (empty, empty, empty)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/common/test_task_planner.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/common/test_task_planner.py b/src/test/python/apache/thermos/common/test_task_planner.py
index ffdc30b..132c1ec 100644
--- a/src/test/python/apache/thermos/common/test_task_planner.py
+++ b/src/test/python/apache/thermos/common/test_task_planner.py
@@ -13,23 +13,26 @@
 #
 
 import pytest
-from twitter.common.testing.clock import ThreadedClock
 
 from apache.thermos.common.planner import TaskPlanner
-from apache.thermos.config.schema import *
+from apache.thermos.config.schema import Constraint, Process, Task
 
-p1 = Process(name = "p1", cmdline = "")
-p2 = Process(name = "p2", cmdline = "")
-p3 = Process(name = "p3", cmdline = "")
+p1 = Process(name="p1", cmdline="")
+p2 = Process(name="p2", cmdline="")
+p3 = Process(name="p3", cmdline="")
 
-unordered_task = Task(name = "unordered", processes = [p1, p2, p3])
-ordered_task = unordered_task(constraints = [{'order': ['p1', 'p2', 'p3']}])
-empty_task = Task(name = "empty", processes = [])
+unordered_task = Task(name="unordered", processes=[p1, p2, p3])
+ordered_task = unordered_task(constraints=[{'order': ['p1', 'p2', 'p3']}])
+empty_task = Task(name="empty", processes=[])
 
-def _(*processes):
+
+def _(*processes):  # noqa
   return set(processes)
+
+
 empty = set()
 
+
 def approx_equal(a, b):
   return abs(a - b) < 0.001
 
@@ -203,7 +206,7 @@ def test_task_waits():
 
 def test_task_fails():
   dt = p1(max_failures=1, min_duration=1)
-  p = TaskPlanner(empty_task(processes = [dt(name='d1'), dt(name='d2')]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1'), dt(name='d2')]))
   assert p.runnable_at(timestamp=0) == _('d1', 'd2')
   p.set_running('d1')
   p.set_running('d2')
@@ -213,7 +216,7 @@ def test_task_fails():
   assert p.runnable_at(timestamp=0) == empty
   assert p.min_wait(timestamp=0) == TaskPlanner.INFINITY
 
-  p = TaskPlanner(empty_task(processes = [dt(name='d1'), dt(name='d2')]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1'), dt(name='d2')]))
   assert p.runnable_at(timestamp=0) == _('d1', 'd2')
   p.set_running('d1')
   p.set_failed('d1')
@@ -225,7 +228,7 @@ def test_task_fails():
   assert p.min_wait(timestamp=0) == TaskPlanner.INFINITY
 
   # test max_failures=0 && daemon==True ==> retries forever
-  p = TaskPlanner(empty_task(processes = [dt(name='d1', max_failures=0, daemon=True)]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1', max_failures=0, daemon=True)]))
   for k in range(10):
     p.set_running('d1')
     assert 'd1' in p.running
@@ -241,7 +244,7 @@ def test_task_fails():
     assert 'd1' not in p.failed
     assert 'd1' not in p.finished
 
-  p = TaskPlanner(empty_task(processes = [dt(name='d1', max_failures=0)]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1', max_failures=0)]))
   p.set_running('d1')
   assert 'd1' in p.running
   assert 'd1' not in p.failed
@@ -261,14 +264,14 @@ def test_task_lost():
   dt = p1(max_failures=2, min_duration=1)
 
   # regular success behavior
-  p = TaskPlanner(empty_task(processes = [dt(name='d1')]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1')]))
   assert p.runnable_at(timestamp=0) == _('d1')
   p.set_running('d1')
   p.add_success('d1', timestamp=0)
   assert p.min_wait(timestamp=0) == TaskPlanner.INFINITY
 
   # regular failure behavior
-  p = TaskPlanner(empty_task(processes = [dt(name='d1')]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1')]))
   assert p.runnable_at(timestamp=0) == _('d1')
   p.set_running('d1')
   p.add_failure('d1', timestamp=1)
@@ -278,7 +281,7 @@ def test_task_lost():
   assert p.min_wait(timestamp=3) == TaskPlanner.INFINITY
 
   # lost behavior
-  p = TaskPlanner(empty_task(processes = [dt(name='d1')]))
+  p = TaskPlanner(empty_task(processes=[dt(name='d1')]))
   assert p.runnable_at(timestamp=0) == _('d1')
   p.set_running('d1')
   p.add_failure('d1', timestamp=1)
@@ -293,18 +296,21 @@ def test_task_lost():
 
 def test_task_filters():
   t = p1
-  task = empty_task(processes = [t(name='p1'), t(name='p2'), t(name='p3'),
-                                 t(name='f1'), t(name='f2'), t(name='f3')],
-                    constraints = [Constraint(order=['p1','p2','p3']),
-                                   Constraint(order=['f1','f2','f3'])])
+  task = empty_task(
+      processes=[
+          t(name='p1'), t(name='p2'), t(name='p3'),
+          t(name='f1'), t(name='f2'), t(name='f3')],
+      constraints=[
+          Constraint(order=['p1', 'p2', 'p3']),
+          Constraint(order=['f1', 'f2', 'f3'])])
   assert TaskPlanner(task, process_filter=lambda proc: proc.name().get().startswith('p'))
   assert TaskPlanner(task, process_filter=lambda proc: proc.name().get().startswith('f'))
 
   with pytest.raises(TaskPlanner.InvalidSchedule):
-    TaskPlanner(task(constraints=[Constraint(order=['p1','f1'])]),
+    TaskPlanner(task(constraints=[Constraint(order=['p1', 'f1'])]),
                 process_filter=lambda proc: proc.name().get().startswith('p'))
   with pytest.raises(TaskPlanner.InvalidSchedule):
-    TaskPlanner(task(constraints=[Constraint(order=['p1','f1'])]),
+    TaskPlanner(task(constraints=[Constraint(order=['p1', 'f1'])]),
                 process_filter=lambda proc: proc.name().get().startswith('f'))
 
 
@@ -313,7 +319,7 @@ def test_task_max_runs():
     TOTAL_RUN_LIMIT = 2
   dt = p1(daemon=True, max_failures=0)
 
-  p = CappedTaskPlanner(empty_task(processes = [dt(name = 'd1', max_failures=100, daemon=False)]))
+  p = CappedTaskPlanner(empty_task(processes=[dt(name='d1', max_failures=100, daemon=False)]))
   p.set_running('d1')
   p.add_failure('d1', timestamp=1)
   assert 'd1' in p.runnable
@@ -321,7 +327,7 @@ def test_task_max_runs():
   p.add_failure('d1', timestamp=2)
   assert 'd1' not in p.runnable
 
-  p = CappedTaskPlanner(empty_task(processes = [dt(name = 'd1', max_failures=100)]))
+  p = CappedTaskPlanner(empty_task(processes=[dt(name='d1', max_failures=100)]))
   p.set_running('d1')
   p.add_failure('d1', timestamp=1)
   assert 'd1' in p.runnable

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/config/test_schema.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/config/test_schema.py b/src/test/python/apache/thermos/config/test_schema.py
index f48f6c6..85b04c0 100644
--- a/src/test/python/apache/thermos/config/test_schema.py
+++ b/src/test/python/apache/thermos/config/test_schema.py
@@ -20,7 +20,6 @@ from apache.thermos.config.schema import (
     concat_tasks,
     Constraint,
     java_options,
-    List,
     order,
     Process,
     python_options,
@@ -50,6 +49,7 @@ def test_order():
   with pytest.raises(ValueError):
     order(None)
 
+
 def test_add_resources():
   assert Units.resources_sum(Resources(), Resources()) == Resources(cpu=0, ram=0, disk=0)
 
@@ -120,8 +120,8 @@ def test_tasklets():
   recipe_ruby19 = SequentialTask(processes=[install_thermosrc, setup_ruby19])
   recipe_php = SequentialTask(processes=[install_thermosrc, setup_php])
   all_recipes = Tasks.combine(recipe_py3k, recipe_ruby19, recipe_php)
-  my_task = Task(processes = [Process(name='my_process')])
-  my_new_task = Tasks.concat(all_recipes, my_task)(name = 'my_task')
+  my_task = Task(processes=[Process(name='my_process')])
+  my_new_task = Tasks.concat(all_recipes, my_task)(name='my_task')
 
   # TODO(wickman) Probably should have Tasks.combine/concat do constraint
   # minimization since many constraints are redundant.
@@ -129,7 +129,6 @@ def test_tasklets():
     assert p in my_new_task.processes()
 
 
-
 def test_render_options():
   def eq(o1, o2):
     return set(o1.split()) == set(o2.split())

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/core/test_angry.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/core/test_angry.py b/src/test/python/apache/thermos/core/test_angry.py
index 02280ed..126ff79 100644
--- a/src/test/python/apache/thermos/core/test_angry.py
+++ b/src/test/python/apache/thermos/core/test_angry.py
@@ -12,8 +12,6 @@
 # limitations under the License.
 #
 
-import random
-
 from apache.thermos.config.schema import Process, Task
 from apache.thermos.testing.runner import Runner
 
@@ -22,14 +20,14 @@ from gen.apache.thermos.ttypes import ProcessState, TaskState
 
 def flaky_task():
   task = Task(
-    name = "failing_task",
-    max_failures = 2,
-    processes = [
-      Process(name = "a", max_failures=1, min_duration=1, cmdline="echo hello world"),
-      Process(name = "b", max_failures=2, min_duration=1, cmdline="exit 1"),
-      Process(name = "c", max_failures=1, min_duration=1, final=True, cmdline="echo hello world")
+    name="failing_task",
+    max_failures=2,
+    processes=[
+      Process(name="a", max_failures=1, min_duration=1, cmdline="echo hello world"),
+      Process(name="b", max_failures=2, min_duration=1, cmdline="exit 1"),
+      Process(name="c", max_failures=1, min_duration=1, final=True, cmdline="echo hello world")
     ],
-    constraints = [{'order': ['a', 'b']}]
+    constraints=[{'order': ['a', 'b']}]
   )
   return task.interpolate()[0]
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/core/test_ephemerals.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/core/test_ephemerals.py b/src/test/python/apache/thermos/core/test_ephemerals.py
index 34b29aa..c81d0bb 100644
--- a/src/test/python/apache/thermos/core/test_ephemerals.py
+++ b/src/test/python/apache/thermos/core/test_ephemerals.py
@@ -12,7 +12,7 @@
 # limitations under the License.
 #
 
-from apache.thermos.config.schema import Process, Resources, Task
+from apache.thermos.config.schema import Process, Task
 from apache.thermos.testing.runner import RunnerTestBase
 
 from gen.apache.thermos.ttypes import ProcessState, TaskState
@@ -22,11 +22,11 @@ class TestEphemeralTask(RunnerTestBase):
   @classmethod
   def task(cls):
     task = Task(
-      name = "task_with_ephemeral",
-      processes = [
-        Process(name = "ephemeral_sleepy", ephemeral=True, cmdline="sleep 10"),
-        Process(name = "sleepy", cmdline="sleep 1")
-      ])
+        name="task_with_ephemeral",
+        processes=[
+          Process(name="ephemeral_sleepy", ephemeral=True, cmdline="sleep 10"),
+          Process(name="sleepy", cmdline="sleep 1")
+        ])
     return task.interpolate()[0]
 
   def test_runner_state(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/467f8428/src/test/python/apache/thermos/core/test_failing_runner.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/thermos/core/test_failing_runner.py b/src/test/python/apache/thermos/core/test_failing_runner.py
index 0c4e812..36a9fc0 100644
--- a/src/test/python/apache/thermos/core/test_failing_runner.py
+++ b/src/test/python/apache/thermos/core/test_failing_runner.py
@@ -25,21 +25,21 @@ class TestFailingRunner(RunnerTestBase):
       name="{{process_name}}",
       min_duration=1,
       max_failures=5,
-      cmdline = "echo {{process_name}} pinging;                                "
-                "echo ping >> {{process_name}};                                "
-                "echo current count $(cat {{process_name}} | wc -l);           "
-                "if [ $(cat {{process_name}} | wc -l) -eq {{num_runs}} ]; then "
-                "  exit 0;                                             "
-                "else                                                  "
-                "  exit 1;                                             "
-                "fi                                                    ")
+      cmdline="echo {{process_name}} pinging;                                "
+              "echo ping >> {{process_name}};                                "
+              "echo current count $(cat {{process_name}} | wc -l);           "
+              "if [ $(cat {{process_name}} | wc -l) -eq {{num_runs}} ]; then "
+              "  exit 0;                                             "
+              "else                                                  "
+              "  exit 1;                                             "
+              "fi                                                    ")
     tsk = Task(
-      name = "pingping",
-      resources = Resources(cpu = 1.0, ram = 16*1024*1024, disk = 16*1024),
-      processes = [
-        ping_template.bind(process_name = "p1", num_runs = 1),
-        ping_template.bind(process_name = "p2", num_runs = 2),
-        ping_template.bind(process_name = "p3", num_runs = 3),
+      name="pingping",
+      resources=Resources(cpu=1.0, ram=16 * 1024 * 1024, disk=16 * 1024),
+      processes=[
+        ping_template.bind(process_name="p1", num_runs=1),
+        ping_template.bind(process_name="p2", num_runs=2),
+        ping_template.bind(process_name="p3", num_runs=3),
       ]
     )
     return tsk.interpolate()[0]
@@ -49,10 +49,10 @@ class TestFailingRunner(RunnerTestBase):
 
   def test_runner_processes_have_expected_runs(self):
     processes = self.state.processes
-    for k in range(1,4):
+    for k in range(1, 4):
       process_name = 'p%d' % k
       assert process_name in processes
       assert len(processes[process_name]) == k
-      for j in range(k-1):
+      for j in range(k - 1):
         assert processes[process_name][j].state == ProcessState.FAILED
-      assert processes[process_name][k-1].state == ProcessState.SUCCESS
+      assert processes[process_name][k - 1].state == ProcessState.SUCCESS


Mime
View raw message