diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py
index 9eb8b6909f..0cb4dfba39 100644
--- a/tests/handlers/test_presence.py
+++ b/tests/handlers/test_presence.py
@@ -14,11 +14,10 @@
# limitations under the License.
-from twisted.trial import unittest
+from tests import unittest
from twisted.internet import defer, reactor
from mock import Mock, call, ANY
-import logging
import json
from ..utils import MockHttpResource, MockClock, DeferredMockCallable
@@ -34,9 +33,6 @@ UNAVAILABLE = PresenceState.UNAVAILABLE
ONLINE = PresenceState.ONLINE
-logging.getLogger().addHandler(logging.NullHandler())
-
-
def _expect_edu(destination, edu_type, content, origin="test"):
return {
"origin": origin,
@@ -92,7 +88,6 @@ class PresenceStateTestCase(unittest.TestCase):
# Mock the RoomMemberHandler
room_member_handler = Mock(spec=[])
hs.handlers.room_member_handler = room_member_handler
- logging.getLogger().debug("Mocking room_member_handler=%r", room_member_handler)
# Some local users to test with
self.u_apple = hs.parse_userid("@apple:test")
@@ -324,7 +319,8 @@ class PresenceInvitesTestCase(unittest.TestCase):
"observer_user": "@apple:test",
"observed_user": "@cabbage:elsewhere",
}
- )
+ ),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -350,7 +346,8 @@ class PresenceInvitesTestCase(unittest.TestCase):
"observer_user": "@cabbage:elsewhere",
"observed_user": "@apple:test",
}
- )
+ ),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -381,7 +378,8 @@ class PresenceInvitesTestCase(unittest.TestCase):
"observer_user": "@cabbage:elsewhere",
"observed_user": "@durian:test",
}
- )
+ ),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -770,7 +768,8 @@ class PresencePushTestCase(unittest.TestCase):
"last_active_ago": 0},
],
}
- )
+ ),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -785,7 +784,8 @@ class PresencePushTestCase(unittest.TestCase):
"last_active_ago": 0},
],
}
- )
+ ),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -911,6 +911,7 @@ class PresencePushTestCase(unittest.TestCase):
],
}
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -925,6 +926,7 @@ class PresencePushTestCase(unittest.TestCase):
],
}
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -954,6 +956,7 @@ class PresencePushTestCase(unittest.TestCase):
],
}
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -1150,6 +1153,7 @@ class PresencePollingTestCase(unittest.TestCase):
"poll": [ "@potato:remote" ],
},
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -1162,6 +1166,7 @@ class PresencePollingTestCase(unittest.TestCase):
"push": [ {"user_id": "@clementine:test" }],
},
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -1190,6 +1195,7 @@ class PresencePollingTestCase(unittest.TestCase):
"push": [ {"user_id": "@fig:test" }],
},
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -1222,6 +1228,7 @@ class PresencePollingTestCase(unittest.TestCase):
"unpoll": [ "@potato:remote" ],
},
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
@@ -1253,6 +1260,7 @@ class PresencePollingTestCase(unittest.TestCase):
],
},
),
+ on_send_callback=ANY,
),
defer.succeed((200, "OK"))
)
|