Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fix test_threepid_invite_spamcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jesopo committed May 10, 2022
1 parent 5caeaaf commit 96c2661
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/rest/client/test_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,9 @@ def test_threepid_invite_spamcheck(self) -> None:

# Add a mock to the spamchecker callbacks for user_may_send_3pid_invite. Make it
# allow everything for now.
mock = Mock(return_value=make_awaitable(True))
# `spec` argument is needed for this function mock to have `__qualname__`, which
# is needed for `Measure` metrics buried in SpamChecker.
mock = Mock(return_value=make_awaitable(True), spec=lambda: None)
self.hs.get_spam_checker()._user_may_send_3pid_invite_callbacks.append(mock)

# Send a 3PID invite into the room and check that it succeeded.
Expand Down

0 comments on commit 96c2661

Please sign in to comment.