mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
tests: Use assertion to enforce None-checks in tests.
This fixes a batch of mypy errors of the following format: 'Item "None" of "Optional[Something]" has no attribute "abc" Since we have already been recklessly using these attritbutes in the tests, adding assertions beforehand is justified presuming that they oughtn't to be None.
This commit is contained in:
@@ -240,6 +240,7 @@ class TestProcessCountStat(AnalyticsTestCase):
|
||||
self, stat: CountStat, end_time: datetime, state: int = FillState.DONE
|
||||
) -> None:
|
||||
fill_state = FillState.objects.filter(property=stat.property).first()
|
||||
assert fill_state is not None
|
||||
self.assertEqual(fill_state.end_time, end_time)
|
||||
self.assertEqual(fill_state.state, state)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user