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

Commit bbafc91

Browse files
author
David Robertson
committed
Fix new mypy complaints related to assertGreater
Presumably due to python/typeshed#8077
1 parent f012474 commit bbafc91

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/storage/test_monthly_active_users.py

+6
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ def test_initialise_reserved_users(self):
9696

9797
# Test each of the registered users is marked as active
9898
timestamp = self.get_success(self.store.user_last_seen_monthly_active(user1))
99+
# Mypy notes that one shouldn't compare Optional[int] to 0 with assertGreater.
100+
# Check that timestamp really is an int.
101+
assert timestamp is not None
99102
self.assertGreater(timestamp, 0)
100103
timestamp = self.get_success(self.store.user_last_seen_monthly_active(user2))
104+
assert timestamp is not None
101105
self.assertGreater(timestamp, 0)
102106

103107
# Test that users with reserved 3pids are not removed from the MAU table
@@ -166,9 +170,11 @@ def test_user_last_seen_monthly_active(self):
166170
self.get_success(self.store.upsert_monthly_active_user(user_id2))
167171

168172
result = self.get_success(self.store.user_last_seen_monthly_active(user_id1))
173+
assert result is not None
169174
self.assertGreater(result, 0)
170175

171176
result = self.get_success(self.store.user_last_seen_monthly_active(user_id3))
177+
assert result is not None
172178
self.assertNotEqual(result, 0)
173179

174180
@override_config({"max_mau_value": 5})

0 commit comments

Comments
 (0)