From 017afadbf72fe7ebeaa681a1456e8effd66a382e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Ca=C3=B1as-D=C3=ADaz?= Date: Wed, 30 Oct 2019 19:56:01 +0100 Subject: [PATCH] Remove not used variables to fix #102 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix error #102 by removing unused variables in an exception at arthur/arthur.py and in two unit tests at test_arthur.py. Signed-off-by: Luis Cañas-Díaz --- arthur/arthur.py | 2 +- tests/test_arthur.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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):