ruff: Fix C405 Unnecessary `list` literal (rewrite as a `set` literal).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-10-29 18:30:40 -04:00 committed by Tim Abbott
parent 033d2615f6
commit 9e53f0c756
2 changed files with 8 additions and 8 deletions

View File

@ -107,7 +107,7 @@ class GitterImporter(ZulipTestCase):
messages["zerver_usermessage"], "user_profile" messages["zerver_usermessage"], "user_profile"
) )
self.assertEqual( self.assertEqual(
set([user_should_not_be_long_term_idle["id"]]), exported_usermessage_userprofile {user_should_not_be_long_term_idle["id"]}, exported_usermessage_userprofile
) )
exported_usermessage_message = self.get_set(messages["zerver_usermessage"], "message") exported_usermessage_message = self.get_set(messages["zerver_usermessage"], "message")
self.assertEqual(exported_usermessage_message, exported_messages_id) self.assertEqual(exported_usermessage_message, exported_messages_id)

View File

@ -678,13 +678,13 @@ class RealmImportExportTest(ExportFile):
.values_list("id", flat=True) .values_list("id", flat=True)
) )
exported_msg_ids = ( exported_msg_ids = {
set(public_stream_message_ids) *public_stream_message_ids,
| set(private_stream_message_ids) *private_stream_message_ids,
| set([stream_b_second_message_id]) stream_b_second_message_id,
| set(exported_pm_ids) *exported_pm_ids,
| set(exported_huddle_ids) *exported_huddle_ids,
) }
self.assertEqual(self.get_set(data["zerver_message"], "id"), exported_msg_ids) self.assertEqual(self.get_set(data["zerver_message"], "id"), exported_msg_ids)
self.assertNotIn(stream_b_first_message_id, exported_msg_ids) self.assertNotIn(stream_b_first_message_id, exported_msg_ids)