Add missing type hints to tests. (#15027)

This commit is contained in:
Patrick Cloke 2023-02-08 14:52:37 -05:00 committed by GitHub
parent 55e4d27b36
commit 4eed7b2ede
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 70 additions and 76 deletions

View file

@ -17,25 +17,25 @@ from tests.utils import MockClock
class MockClockTestCase(unittest.TestCase):
def setUp(self):
def setUp(self) -> None:
self.clock = MockClock()
def test_advance_time(self):
def test_advance_time(self) -> None:
start_time = self.clock.time()
self.clock.advance_time(20)
self.assertEqual(20, self.clock.time() - start_time)
def test_later(self):
def test_later(self) -> None:
invoked = [0, 0]
def _cb0():
def _cb0() -> None:
invoked[0] = 1
self.clock.call_later(10, _cb0)
def _cb1():
def _cb1() -> None:
invoked[1] = 1
self.clock.call_later(20, _cb1)
@ -51,15 +51,15 @@ class MockClockTestCase(unittest.TestCase):
self.assertTrue(invoked[1])
def test_cancel_later(self):
def test_cancel_later(self) -> None:
invoked = [0, 0]
def _cb0():
def _cb0() -> None:
invoked[0] = 1
t0 = self.clock.call_later(10, _cb0)
def _cb1():
def _cb1() -> None:
invoked[1] = 1
self.clock.call_later(20, _cb1)