diff --git a/luigi/execution_summary.py b/luigi/execution_summary.py index a430fd61c8..e818a1ed14 100644 --- a/luigi/execution_summary.py +++ b/luigi/execution_summary.py @@ -94,14 +94,14 @@ def _partition_tasks(worker): Still_pending_not_ext is only used to get upstream_failure, upstream_missing_dependency and run_by_other_worker """ task_history = worker._add_task_history - pending_tasks = {task for(task, status, ext) in task_history if status == 'PENDING'} + pending_tasks = {task for (task, status, ext) in task_history if status == 'PENDING'} set_tasks = {} set_tasks["completed"] = {task for (task, status, ext) in task_history if status == 'DONE' and task in pending_tasks} set_tasks["already_done"] = {task for (task, status, ext) in task_history if status == 'DONE' and task not in pending_tasks and task not in set_tasks["completed"]} set_tasks["ever_failed"] = {task for (task, status, ext) in task_history if status == 'FAILED'} set_tasks["failed"] = set_tasks["ever_failed"] - set_tasks["completed"] - set_tasks["scheduling_error"] = {task for(task, status, ext) in task_history if status == 'UNKNOWN'} + set_tasks["scheduling_error"] = {task for (task, status, ext) in task_history if status == 'UNKNOWN'} set_tasks["still_pending_ext"] = {task for (task, status, ext) in task_history if status == 'PENDING' and task not in set_tasks["ever_failed"] and task not in set_tasks["completed"] and not ext} set_tasks["still_pending_not_ext"] = {task for (task, status, ext) in task_history diff --git a/luigi/interface.py b/luigi/interface.py index 5fd33b947e..6a2b336866 100644 --- a/luigi/interface.py +++ b/luigi/interface.py @@ -146,7 +146,7 @@ def _schedule_and_run(tasks, worker_scheduler_factory=None, override_defaults=No kill_signal = signal.SIGUSR1 if env_params.take_lock else None if (not env_params.no_lock and - not(lock.acquire_for(env_params.lock_pid_dir, env_params.lock_size, kill_signal))): + not (lock.acquire_for(env_params.lock_pid_dir, env_params.lock_size, kill_signal))): raise PidLockAlreadyTakenExit() if env_params.local_scheduler: diff --git a/luigi/tools/deps_tree.py b/luigi/tools/deps_tree.py index 9f207341b7..77e49e2229 100755 --- a/luigi/tools/deps_tree.py +++ b/luigi/tools/deps_tree.py @@ -50,7 +50,7 @@ def print_tree(task, indent='', last=True): name = task.__class__.__name__ params = task.to_str_params(only_significant=True) result = '\n' + indent - if(last): + if (last): result += '└─--' indent += ' ' else: diff --git a/test/task_test.py b/test/task_test.py index c3f569423b..cd95b88b87 100644 --- a/test/task_test.py +++ b/test/task_test.py @@ -78,7 +78,7 @@ def test_task_missing_necessary_param(self): def test_external_tasks_loadable(self): task = load_task("luigi", "ExternalTask", {}) - assert(isinstance(task, luigi.ExternalTask)) + self.assertTrue(isinstance(task, luigi.ExternalTask)) def test_getpaths(self): class RequiredTask(luigi.Task):