diff options
author | David Robertson <davidr@element.io> | 2022-06-11 20:20:46 +0100 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2022-06-11 21:45:05 +0100 |
commit | d091b71ea2f17b5f0e8a1fe4eda9f78f13071d80 (patch) | |
tree | 1c3c435bf55af4c3cccf74e4209a09adcb24ca3a | |
parent | Changelog (diff) | |
download | synapse-d091b71ea2f17b5f0e8a1fe4eda9f78f13071d80.tar.xz |
Type tests.util.test_wheel_timer
-rw-r--r-- | mypy.ini | 1 | ||||
-rw-r--r-- | tests/util/test_wheel_timer.py | 16 |
2 files changed, 8 insertions, 9 deletions
diff --git a/mypy.ini b/mypy.ini index 6590f0c25f..445ab2d962 100644 --- a/mypy.ini +++ b/mypy.ini @@ -74,7 +74,6 @@ exclude = (?x) |tests/util/test_logcontext.py |tests/util/test_lrucache.py |tests/util/test_rwlock.py - |tests/util/test_wheel_timer.py )$ [mypy-synapse.federation.transport.client] diff --git a/tests/util/test_wheel_timer.py b/tests/util/test_wheel_timer.py index 0d5039de04..1c846ab0a7 100644 --- a/tests/util/test_wheel_timer.py +++ b/tests/util/test_wheel_timer.py @@ -18,8 +18,8 @@ from .. import unittest class WheelTimerTestCase(unittest.TestCase): - def test_single_insert_fetch(self): - wheel = WheelTimer(bucket_size=5) + def test_single_insert_fetch(self) -> None: + wheel: WheelTimer[object] = WheelTimer(bucket_size=5) obj = object() wheel.insert(100, obj, 150) @@ -32,8 +32,8 @@ class WheelTimerTestCase(unittest.TestCase): self.assertListEqual(wheel.fetch(156), [obj]) self.assertListEqual(wheel.fetch(170), []) - def test_multi_insert(self): - wheel = WheelTimer(bucket_size=5) + def test_multi_insert(self) -> None: + wheel: WheelTimer[object] = WheelTimer(bucket_size=5) obj1 = object() obj2 = object() @@ -50,15 +50,15 @@ class WheelTimerTestCase(unittest.TestCase): self.assertListEqual(wheel.fetch(200), [obj3]) self.assertListEqual(wheel.fetch(210), []) - def test_insert_past(self): - wheel = WheelTimer(bucket_size=5) + def test_insert_past(self) -> None: + wheel: WheelTimer["object"] = WheelTimer(bucket_size=5) obj = object() wheel.insert(100, obj, 50) self.assertListEqual(wheel.fetch(120), [obj]) - def test_insert_past_multi(self): - wheel = WheelTimer(bucket_size=5) + def test_insert_past_multi(self) -> None: + wheel: WheelTimer[object] = WheelTimer(bucket_size=5) obj1 = object() obj2 = object() |