diff options
author | 2020-03-17 20:10:50 +0100 | |
---|---|---|
committer | 2020-03-17 20:10:50 +0100 | |
commit | c68b943708eaca110ddfa6121872513a422bbef4 (patch) | |
tree | 1c6fc06017c99c38478f621a31a232b5191afaf7 /tests | |
parent | Add docstring to test. (diff) |
Use set `discard` instead of `remove`.
Discard ignores non present values,
allowing us to skip the KeyError suppress.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/cogs/moderation/test_silence.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py index 71541086d..eee020455 100644 --- a/tests/bot/cogs/moderation/test_silence.py +++ b/tests/bot/cogs/moderation/test_silence.py @@ -195,7 +195,7 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase): channel = MockTextChannel(overwrites_for=Mock(return_value=perm_overwrite)) with mock.patch.object(self.cog, "muted_channels") as muted_channels: await self.cog._unsilence(channel) - muted_channels.remove.assert_called_once_with(channel) + muted_channels.discard.assert_called_once_with(channel) @mock.patch("bot.cogs.moderation.silence.asyncio") @mock.patch.object(Silence, "_mod_alerts_channel", create=True) |