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

Commit

Permalink
Fix new mypy complaints related to assertGreater
Browse files Browse the repository at this point in the history
Presumably due to python/typeshed#8077
  • Loading branch information
David Robertson committed Sep 30, 2022
1 parent f012474 commit bbafc91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/storage/test_monthly_active_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ def test_initialise_reserved_users(self):

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

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

result = self.get_success(self.store.user_last_seen_monthly_active(user_id1))
assert result is not None
self.assertGreater(result, 0)

result = self.get_success(self.store.user_last_seen_monthly_active(user_id3))
assert result is not None
self.assertNotEqual(result, 0)

@override_config({"max_mau_value": 5})
Expand Down

0 comments on commit bbafc91

Please sign in to comment.