Skip to content

Commit

Permalink
Revert to earlier version of pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
lexicalunit committed Jul 30, 2024
1 parent ea3e127 commit 914dcb2
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 258 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/cogs/test_lfg_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def test_lfg_fully_seated(

with mock_operations(lfg_action, users=[other_player]):
message = MagicMock(spec=discord.Message)
message.id = game.posts[0].message_xid # type: ignore
message.id = game.posts[0].message_xid
lfg_action.safe_get_partial_message.return_value = message

await self.run(cog.lfg)
Expand Down
8 changes: 4 additions & 4 deletions tests/cogs/test_lfg_cog_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ async def test_concurrent_lfg_requests_different_channels(self, bot: SpellBot) -
messages_out_of_order = False
message_xid: int | None = None
for game in games: # pragma: no cover
if message_xid and game.posts[0].message_xid != message_xid + 1: # type: ignore
if message_xid and game.posts[0].message_xid != message_xid + 1:
# At least one game is out of order, this is good!
messages_out_of_order = True
break
message_xid = game.posts[0].message_xid # type: ignore
message_xid = game.posts[0].message_xid
assert messages_out_of_order

async def test_concurrent_lfg_requests_same_channel(
Expand Down Expand Up @@ -108,9 +108,9 @@ def get_next_message(*args: Any, **kwargs: Any) -> discord.Message:
messages_out_of_order = False
message_xid: int | None = None
for game in games: # pragma: no cover
if message_xid is not None and game.posts[0].message_xid != message_xid + 1: # type: ignore
if message_xid is not None and game.posts[0].message_xid != message_xid + 1:
# At least one game is out of order, this is good!
messages_out_of_order = True
break
message_xid = game.posts[0].message_xid # type: ignore
message_xid = game.posts[0].message_xid
assert messages_out_of_order
6 changes: 3 additions & 3 deletions tests/cogs/test_lfg_cog_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def test_points(
user = self.factories.user.create(xid=self.interaction.user.id)
other_user = self.factories.user.create(xid=self.interaction.user.id + 1, game=game)
other_player = mock_discord_object(other_user)
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid) # type: ignore
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid)
self.interaction.original_response.return_value = message

with patch.object(
Expand Down Expand Up @@ -165,7 +165,7 @@ async def test_points_when_message_not_found(
user = self.factories.user.create(xid=self.interaction.user.id)
other_user = self.factories.user.create(xid=self.interaction.user.id + 1, game=game)
other_player = mock_discord_object(other_user)
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid) # type: ignore
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid)
self.interaction.original_response.return_value = message

with patch.object(
Expand Down Expand Up @@ -247,7 +247,7 @@ async def test_points_when_not_in_game(
self.factories.user.create(xid=self.interaction.user.id)
other_user = self.factories.user.create(xid=self.interaction.user.id + 1, game=game)
other_player = mock_discord_object(other_user)
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid) # type: ignore
message = MagicMock(spec=discord.Message, id=game.posts[0].message_xid)
self.interaction.original_response.return_value = message

outside_user = self.factories.user.create(xid=self.interaction.user.id + 2)
Expand Down
Loading

0 comments on commit 914dcb2

Please sign in to comment.