aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-03-10 22:38:59 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-03-10 22:38:59 +0300
commitb867fb21b6a14f91aa608009aa7eef540a4792dc (patch)
tree646a50e58df8e4f1c237feca19789efa0c37a517 /tests
parentSimplifies Redundant Unsilence Target Test (diff)
Use Mock Side Effect Instead Of Extra Function
Changes the mock used for creating an erroneous function in the silence tests cog to use the side effect property instead of an extra function. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/exts/moderation/test_silence.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/bot/exts/moderation/test_silence.py b/tests/bot/exts/moderation/test_silence.py
index 5f2e67ac2..a297cc8cb 100644
--- a/tests/bot/exts/moderation/test_silence.py
+++ b/tests/bot/exts/moderation/test_silence.py
@@ -233,9 +233,7 @@ class SilenceCogTests(unittest.IsolatedAsyncioTestCase):
Returns the list of erroneous members,
as well as a list of regular and erroneous members combined, in that order.
"""
- def failing_move_to(*_):
- raise Exception()
- erroneous_members = [MockMember(move_to=Mock(failing_move_to)) for _ in range(5)]
+ erroneous_members = [MockMember(move_to=Mock(side_effect=Exception())) for _ in range(5)]
members = []
for i in range(5):