async-timer 1.1.4__tar.gz → 1.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {async_timer-1.1.4 → async_timer-1.1.5}/PKG-INFO +1 -1
- {async_timer-1.1.4 → async_timer-1.1.5}/pyproject.toml +1 -1
- {async_timer-1.1.4 → async_timer-1.1.5}/src/mock_async_timer/timer.py +8 -1
- {async_timer-1.1.4 → async_timer-1.1.5}/README.md +0 -0
- {async_timer-1.1.4 → async_timer-1.1.5}/src/async_timer/__init__.py +0 -0
- {async_timer-1.1.4 → async_timer-1.1.5}/src/async_timer/pacemaker.py +0 -0
- {async_timer-1.1.4 → async_timer-1.1.5}/src/async_timer/timer.py +0 -0
- {async_timer-1.1.4 → async_timer-1.1.5}/src/async_timer/traget_caller.py +0 -0
- {async_timer-1.1.4 → async_timer-1.1.5}/src/mock_async_timer/__init__.py +0 -0
|
@@ -24,6 +24,13 @@ class MockPacemaker(async_timer.pacemaker.TimerPacemaker):
|
|
|
24
24
|
asyncio.get_event_loop().call_soon(lambda: fut.set_result(42))
|
|
25
25
|
await fut
|
|
26
26
|
|
|
27
|
+
@classmethod
|
|
28
|
+
def fromPacemaker(cls, original: async_timer.pacemaker.TimerPacemaker):
|
|
29
|
+
"""Create MockPacemaker from the non-mock original."""
|
|
30
|
+
out = cls(delay=original.delay)
|
|
31
|
+
out.stop_on(original._cancel_futs)
|
|
32
|
+
return out
|
|
33
|
+
|
|
27
34
|
|
|
28
35
|
class MockTimer(async_timer.Timer):
|
|
29
36
|
"""Test-friendly mock timer class.
|
|
@@ -36,4 +43,4 @@ class MockTimer(async_timer.Timer):
|
|
|
36
43
|
|
|
37
44
|
def __init__(self, *args, **kwargs):
|
|
38
45
|
super().__init__(*args, **kwargs)
|
|
39
|
-
self.pacemaker = MockPacemaker(self.pacemaker
|
|
46
|
+
self.pacemaker = MockPacemaker.fromPacemaker(self.pacemaker)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|