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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: async-timer
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: The missing Python async timer.
5
5
  License: MIT
6
6
  Keywords: async,timer
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "async-timer"
3
- version = "v1.1.4"
3
+ version = "v1.1.5"
4
4
  description = "The missing Python async timer."
5
5
  authors = ["Ilya O. <vrghost@gmail.com>"]
6
6
  license = "MIT"
@@ -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.delay)
46
+ self.pacemaker = MockPacemaker.fromPacemaker(self.pacemaker)
File without changes