Skip to content
Snippets Groups Projects
Commit 6f16bfa8 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fixed #48

parent 9779f111
No related branches found
No related tags found
No related merge requests found
# v2.17.19
* fixed #49
* fixed #48
__version__ = '2.17.19a2'
__version__ = '2.17.19a3'
......@@ -44,7 +44,7 @@ class measure:
>>> class Test:
>>> @measure()
>>> def measuring(self, measurement_object: measure):
>>> def measuring(self, measurement_object: measure, arg1):
>>> ...
You can also measure how long does executing a future take, eg.
......
......@@ -13,6 +13,25 @@ from concurrent.futures import Future
class TestTime(unittest.TestCase):
def test_measure_as_method(self):
self2 = self
class MyClass:
def __init__(self):
self.a = 1
@measure()
def function(self, v, b):
time.sleep(1)
self.a += b
self2.assertGreaterEqual(v(), 1)
d = MyClass()
with measure() as m:
d.function(2)
self.assertGreaterEqual(m(), 1)
self.assertEqual(d.a, 3)
def test_exponential_backoff_grace(self):
eb = ExponentialBackoff(grace_amount=2)
self.assertTrue(eb.available)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment