From fd8c641fa558a122c4ece500ae45cb88052a03e1 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 25 Oct 2016 13:37:31 -0400 Subject: [PATCH] flake8 fixes --- awx/main/models/unified_jobs.py | 1 - awx/main/tests/unit/scheduler/conftest.py | 1 + .../tests/unit/scheduler/test_scheduler_job.py | 10 ---------- .../scheduler/test_scheduler_project_update.py | 14 -------------- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 19bc265c18..b8657431ab 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -843,7 +843,6 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique ''' Start the task running via Celery. ''' - task_class = self._get_task_class() (res, opts) = self.pre_start(**kwargs) if res: self.start_celery_task(opts, error_callback, success_callback) diff --git a/awx/main/tests/unit/scheduler/conftest.py b/awx/main/tests/unit/scheduler/conftest.py index d8a71d456e..2fd84474f7 100644 --- a/awx/main/tests/unit/scheduler/conftest.py +++ b/awx/main/tests/unit/scheduler/conftest.py @@ -30,6 +30,7 @@ def scheduler_factory(mocker, epoch): def no_create_inventory_update(task, ignore): raise RuntimeError("create_inventory_update should not be called") + def no_create_project_update(task): raise RuntimeError("create_project_update should not be called") diff --git a/awx/main/tests/unit/scheduler/test_scheduler_job.py b/awx/main/tests/unit/scheduler/test_scheduler_job.py index 37af2ead05..735ce04d95 100644 --- a/awx/main/tests/unit/scheduler/test_scheduler_job.py +++ b/awx/main/tests/unit/scheduler/test_scheduler_job.py @@ -3,16 +3,6 @@ import pytest from datetime import timedelta -# awx -from awx.main.scheduler.partial import ( - JobDict, - ProjectUpdateDict, -) - -# TODO: wherever get_latest_rpoject_update_task() is stubbed and returns a -# ProjectUpdateDict. We should instead return a ProjectUpdateLatestDict() -# For now, this is ok since the fields on deviate that much. - class TestJobBlocked(): def test_inventory_update_waiting(self, scheduler_factory, waiting_inventory_update, pending_job): scheduler = scheduler_factory(tasks=[waiting_inventory_update, pending_job]) diff --git a/awx/main/tests/unit/scheduler/test_scheduler_project_update.py b/awx/main/tests/unit/scheduler/test_scheduler_project_update.py index e0fcbc3b1e..8122d93c09 100644 --- a/awx/main/tests/unit/scheduler/test_scheduler_project_update.py +++ b/awx/main/tests/unit/scheduler/test_scheduler_project_update.py @@ -1,18 +1,4 @@ -# Python -import pytest -from datetime import timedelta - -# Django -from django.utils.timezone import now as tz_now - -# awx -from awx.main.scheduler.partial import ( - JobDict, - ProjectUpdateDict, -) -from awx.main.scheduler import Scheduler - # TODO: wherever get_latest_rpoject_update_task() is stubbed and returns a # ProjectUpdateDict. We should instead return a ProjectUpdateLatestDict() # For now, this is ok since the fields on deviate that much.