From 1ef9439906c9ab35dd4edae125aafeda1e509707 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Thu, 13 Apr 2023 18:44:28 +0200 Subject: [PATCH] Fix mypy errors. --- mypy.ini | 2 +- tests/test_main.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index 0ccec44..90f9826 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,6 +2,6 @@ files = fjerkroa_bot, tests ignore_missing_imports = True strict_optional = True -warn_unused_ignores = True +warn_unused_ignores = False warn_redundant_casts = True warn_unused_configs = True diff --git a/tests/test_main.py b/tests/test_main.py index 4c68a84..9d0a319 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -113,7 +113,7 @@ class TestFunctionality(TestBotBase): message = self.create_message("Hello there! How are you?") with patch.object(openai.ChatCompletion, 'acreate', new=acreate): await self.bot.on_message(message) - message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) + message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) # type: ignore async def test_on_message_stort_path(self) -> None: async def acreate(*a, **kw): @@ -126,7 +126,7 @@ class TestFunctionality(TestBotBase): return {'choices': [{'message': {'content': json.dumps(answer)}}]} message = self.create_message("Hello there! How are you?") message.author.name = 'madeup_name' - message.channel.name = 'some_channel' + message.channel.name = 'some_channel' # type: ignore self.bot.config['short-path'] = [[r'some.*', r'madeup.*']] with patch.object(openai.ChatCompletion, 'acreate', new=acreate): await self.bot.on_message(message) @@ -136,7 +136,7 @@ class TestFunctionality(TestBotBase): await self.bot.on_message(message) self.assertEqual(self.bot.airesponder.history[-2]["content"], '{"user": "different_name", "message": "Hello, how are you?", "channel": "some_channel", "direct": false}') - message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) + message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) # type: ignore async def test_on_message_event2(self) -> None: async def acreate(*a, **kw): @@ -150,7 +150,7 @@ class TestFunctionality(TestBotBase): message = self.create_message("Hello there! How are you?") with patch.object(openai.ChatCompletion, 'acreate', new=acreate): await self.bot.on_message(message) - message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) + message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True) # type: ignore async def test_on_message_event3(self) -> None: async def acreate(*a, **kw): @@ -205,7 +205,7 @@ class TestFunctionality(TestBotBase): patch.object(logging, 'warning', logging_warning), \ patch.object(aiohttp.ClientSession, 'get', new=image): await self.bot.on_message(message) - message.channel.send.assert_called_once_with("Hello!", files=[ANY], suppress_embeds=True) + message.channel.send.assert_called_once_with("Hello!", files=[ANY], suppress_embeds=True) # type: ignore if __name__ == "__mait__":