diff --git a/zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py b/zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py index 0aac885..7c637df 100644 --- a/zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py +++ b/zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py @@ -226,7 +226,6 @@ class TestDropboxBot(BotTestCase, DefaultTests): mkdir_error_response = "ERROR: syntax: mkdir " rm_error_response = "ERROR: syntax: rm " write_error_response = "ERROR: syntax: write " - search_error_response = "ERROR: syntax: search " share_error_response = "ERROR: syntax: share " usage_error_response = "ERROR: syntax: usage" diff --git a/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py b/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py index 6f9c596..decba49 100644 --- a/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py +++ b/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py @@ -19,7 +19,7 @@ class TestFileUploaderBot(BotTestCase, DefaultTests): def test_file_upload_failed(self, is_file: Mock, resolve: Mock) -> None: server_reply = dict(result='', msg='error') with patch('zulip_bots.test_lib.StubBotHandler.upload_file_from_path', - return_value=server_reply) as m: + return_value=server_reply): self.verify_reply('file.txt', 'Failed to upload `/file.txt` file: error') @patch('pathlib.Path.resolve', return_value=Path('/file.txt')) @@ -27,7 +27,7 @@ class TestFileUploaderBot(BotTestCase, DefaultTests): def test_file_upload_success(self, is_file: Mock, resolve: Mock) -> None: server_reply = dict(result='success', uri='https://file/uri') with patch('zulip_bots.test_lib.StubBotHandler.upload_file_from_path', - return_value=server_reply) as m: + return_value=server_reply): self.verify_reply('file.txt', '[file.txt](https://file/uri)') def test_help(self): diff --git a/zulip_bots/zulip_bots/bots/giphy/giphy.py b/zulip_bots/zulip_bots/bots/giphy/giphy.py index eb7dc29..78efd8b 100644 --- a/zulip_bots/zulip_bots/bots/giphy/giphy.py +++ b/zulip_bots/zulip_bots/bots/giphy/giphy.py @@ -69,7 +69,7 @@ def get_url_gif_giphy(keyword: str, api_key: str) -> Union[int, str]: try: data = requests.get(url, params=query) - except requests.exceptions.ConnectionError as e: # Usually triggered by bad connection. + except requests.exceptions.ConnectionError: # Usually triggered by bad connection. logging.exception('Bad connection') raise data.raise_for_status() diff --git a/zulip_bots/zulip_bots/bots/idonethis/test_idonethis.py b/zulip_bots/zulip_bots/bots/idonethis/test_idonethis.py index a4ea778..847148f 100644 --- a/zulip_bots/zulip_bots/bots/idonethis/test_idonethis.py +++ b/zulip_bots/zulip_bots/bots/idonethis/test_idonethis.py @@ -61,7 +61,7 @@ class TestIDoneThisBot(BotTestCase, DefaultTests): def test_entries_list(self) -> None: with self.mock_config_info({'api_key': '12345678', 'default_team': 'testing team 1'}), \ self.mock_http_conversation('test_entries_list'), \ - patch('zulip_bots.bots.idonethis.idonethis.get_team_hash', return_value='31415926535') as get_team_hashFunction: + patch('zulip_bots.bots.idonethis.idonethis.get_team_hash', return_value='31415926535'): self.verify_reply('entries list testing team 1', 'Entries for testing team 1:\n' ' * TESTING\n' diff --git a/zulip_bots/zulip_bots/bots/trivia_quiz/test_trivia_quiz.py b/zulip_bots/zulip_bots/bots/trivia_quiz/test_trivia_quiz.py index 989f893..56ceab0 100644 --- a/zulip_bots/zulip_bots/bots/trivia_quiz/test_trivia_quiz.py +++ b/zulip_bots/zulip_bots/bots/trivia_quiz/test_trivia_quiz.py @@ -100,7 +100,7 @@ class TestTriviaQuizBot(BotTestCase, DefaultTests): # test correct answer with patch('zulip_bots.bots.trivia_quiz.trivia_quiz.get_quiz_from_id', return_value=json.dumps(quiz)): - with patch('zulip_bots.bots.trivia_quiz.trivia_quiz.start_new_quiz') as mock_new_quiz: + with patch('zulip_bots.bots.trivia_quiz.trivia_quiz.start_new_quiz'): self._test('answer Q001 A', ':tada: **Amphibian** is correct, Foo Test User!') def test_update_quiz(self) -> None: diff --git a/zulip_bots/zulip_bots/bots/xkcd/xkcd.py b/zulip_bots/zulip_bots/bots/xkcd/xkcd.py index 39be875..96df848 100644 --- a/zulip_bots/zulip_bots/bots/xkcd/xkcd.py +++ b/zulip_bots/zulip_bots/bots/xkcd/xkcd.py @@ -113,7 +113,7 @@ def fetch_xkcd_query(mode: int, comic_id: Optional[str]=None) -> Dict[str, str]: raise XkcdServerError() xkcd_json = fetched.json() - except requests.exceptions.ConnectionError as e: + except requests.exceptions.ConnectionError: logging.exception("Connection Error") raise diff --git a/zulip_bots/zulip_bots/bots/youtube/youtube.py b/zulip_bots/zulip_bots/bots/youtube/youtube.py index bbb5f53..66fbac1 100644 --- a/zulip_bots/zulip_bots/bots/youtube/youtube.py +++ b/zulip_bots/zulip_bots/bots/youtube/youtube.py @@ -66,7 +66,7 @@ def search_youtube(query: str, key: str, url = 'https://www.googleapis.com/youtube/v3/search' try: r = requests.get(url, params=params) - except ConnectionError as e: # Usually triggered by bad connection. + except ConnectionError: # Usually triggered by bad connection. logging.exception('Bad connection') raise r.raise_for_status() diff --git a/zulip_bots/zulip_bots/tests/test_lib.py b/zulip_bots/zulip_bots/tests/test_lib.py index 2c93903..dede35a 100644 --- a/zulip_bots/zulip_bots/tests/test_lib.py +++ b/zulip_bots/zulip_bots/tests/test_lib.py @@ -133,13 +133,12 @@ class LibTest(TestCase): def test_content_and_full_content(self): client = FakeClient() client.get_profile() - handler = ExternalBotHandler( + ExternalBotHandler( client=client, root_dir=None, bot_details=None, bot_config_file=None ) - to = {'email': 'Some@User'} def test_run_message_handler_for_bot(self): with patch('zulip_bots.lib.Client', new=FakeClient) as fake_client: