cleanup: Remove unused variables.
Generated by autoflake. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
f5d96dbcce
commit
54b2578204
13 changed files with 20 additions and 20 deletions
|
@ -67,8 +67,8 @@ at syntax by: @mention-botname help"
|
|||
right now.\nPlease try again later')
|
||||
|
||||
def test_invalid_when_handle_message(self) -> None:
|
||||
bot = get_bot_message_handler(self.bot_name)
|
||||
bot_handler = StubBotHandler()
|
||||
get_bot_message_handler(self.bot_name)
|
||||
StubBotHandler()
|
||||
|
||||
with self.mock_config_info({'auth_token': 'someInvalidKey',
|
||||
'username': 'aaron',
|
||||
|
|
|
@ -65,7 +65,7 @@ class DefineHandler:
|
|||
example = d['example'] if d['example'] else '*No example available.*'
|
||||
response += '\n' + '* (**{}**) {}\n {}'.format(d['type'], d['definition'], html2text.html2text(example))
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
response += self.REQUEST_ERROR_MESSAGE
|
||||
logging.exception("")
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class MockTextRequest():
|
|||
def mock_dialogflow(test_name: str, bot_name: str) -> Iterator[None]:
|
||||
response_data = read_bot_fixture_data(bot_name, test_name)
|
||||
try:
|
||||
df_request = response_data['request']
|
||||
response_data['request']
|
||||
df_response = response_data['response']
|
||||
except KeyError:
|
||||
print("ERROR: 'request' or 'response' field not found in fixture.")
|
||||
|
|
|
@ -33,8 +33,8 @@ class TestGiphyBot(BotTestCase, DefaultTests):
|
|||
)
|
||||
|
||||
def test_invalid_config(self) -> None:
|
||||
bot = get_bot_message_handler(self.bot_name)
|
||||
bot_handler = StubBotHandler()
|
||||
get_bot_message_handler(self.bot_name)
|
||||
StubBotHandler()
|
||||
with self.mock_http_conversation('test_403'):
|
||||
self.validate_invalid_config({'key': '12345678'},
|
||||
"This is likely due to an invalid key.\n")
|
||||
|
@ -45,8 +45,8 @@ class TestGiphyBot(BotTestCase, DefaultTests):
|
|||
self.validate_invalid_config({'key': '12345678'}, str(error))
|
||||
|
||||
def test_valid_config(self) -> None:
|
||||
bot = get_bot_message_handler(self.bot_name)
|
||||
bot_handler = StubBotHandler()
|
||||
get_bot_message_handler(self.bot_name)
|
||||
StubBotHandler()
|
||||
with self.mock_http_conversation('test_normal'):
|
||||
self.validate_valid_config({'key': '12345678'})
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ def beat(message, topic_name, merels_storage):
|
|||
we want to keep the turn of the same played,
|
||||
an empty string otherwise.
|
||||
"""
|
||||
merels = database.MerelsStorage(topic_name, merels_storage)
|
||||
database.MerelsStorage(topic_name, merels_storage)
|
||||
match = COMMAND_PATTERN.match(message)
|
||||
same_player_move = "" # message indicating move of the same player
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ class TestYoutubeBot(BotTestCase, DefaultTests):
|
|||
bot.initialize(bot_handler)
|
||||
|
||||
def test_multiple(self) -> None:
|
||||
bot = get_bot_message_handler(self.bot_name)
|
||||
bot_handler = StubBotHandler()
|
||||
get_bot_message_handler(self.bot_name)
|
||||
StubBotHandler()
|
||||
|
||||
bot_response = 'Here is what I found for `marvel` : ' \
|
||||
'\n * Marvel Studios\' Avengers: Infinity War Official Trailer - [Watch now](https://www.youtube.com/watch/6ZfuNTqbHE8)' \
|
||||
|
|
|
@ -637,7 +637,7 @@ To move subjects, send your message again, otherwise join the game using the lin
|
|||
def get_user_cache(self) -> Dict[str, Any]:
|
||||
try:
|
||||
user_cache_str = self.bot_handler.storage.get('users')
|
||||
except KeyError as e:
|
||||
except KeyError:
|
||||
return {}
|
||||
self.user_cache = json.loads(user_cache_str)
|
||||
return self.user_cache
|
||||
|
@ -850,7 +850,7 @@ class GameInstance:
|
|||
|
||||
def make_move(self, content: str, is_computer: bool) -> None:
|
||||
try:
|
||||
board = self.model.make_move(content, self.turn, is_computer)
|
||||
self.model.make_move(content, self.turn, is_computer)
|
||||
# Keep the turn of the same player
|
||||
except SamePlayerMove as smp:
|
||||
self.same_player_turn(content, smp.message, is_computer)
|
||||
|
|
|
@ -111,7 +111,7 @@ def main() -> None:
|
|||
|
||||
try:
|
||||
lib_module = finder.import_module_from_source(bot_path, bot_name)
|
||||
except ImportError as e:
|
||||
except ImportError:
|
||||
req_path = os.path.join(os.path.dirname(bot_path), "requirements.txt")
|
||||
with open(req_path) as fp:
|
||||
deps_list = fp.read()
|
||||
|
|
|
@ -132,7 +132,7 @@ class LibTest(TestCase):
|
|||
|
||||
def test_content_and_full_content(self):
|
||||
client = FakeClient()
|
||||
profile = client.get_profile()
|
||||
client.get_profile()
|
||||
handler = ExternalBotHandler(
|
||||
client=client,
|
||||
root_dir=None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue