diff --git a/arthur/arthur.py b/arthur/arthur.py index 3279ffd..09ba3c5 100644 --- a/arthur/arthur.py +++ b/arthur/arthur.py @@ -95,7 +95,7 @@ def remove_task(self, task_id): """ try: self._scheduler.cancel_task(task_id) - except NotFoundError as e: + except NotFoundError: logger.info("Cannot cancel %s task because it does not exist.", task_id) return False diff --git a/tests/test_arthur.py b/tests/test_arthur.py index d20b24e..975bb1b 100644 --- a/tests/test_arthur.py +++ b/tests/test_arthur.py @@ -288,7 +288,7 @@ def test_task_wrong_delay(self): app = Arthur(self.conn, async_mode=False) - with self.assertRaisesRegex(ValueError, INVALID_SCHEDULER_DELAY) as ex: + with self.assertRaisesRegex(ValueError, INVALID_SCHEDULER_DELAY): app.add_task(task_id, backend, category, backend_params, sched_args=sched_params) def test_task_wrong_max_retries(self): @@ -302,7 +302,7 @@ def test_task_wrong_max_retries(self): app = Arthur(self.conn, async_mode=False) - with self.assertRaisesRegex(ValueError, INVALID_SCHEDULER_MAX_RETRIES) as ex: + with self.assertRaisesRegex(ValueError, INVALID_SCHEDULER_MAX_RETRIES): app.add_task(task_id, backend, category, backend_params, sched_args=sched_params) def test_add_duplicated_task(self):