Merge ""round" with ndigits=None returns an integer"
This commit is contained in:
commit
69646dc461
|
@ -544,13 +544,13 @@ class TimerTestCase(base.BaseTestCase):
|
||||||
def test__getattr(self):
|
def test__getattr(self):
|
||||||
with utils.Timer() as timer:
|
with utils.Timer() as timer:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.assertEqual(1.0, round(timer.total_seconds(), 0))
|
self.assertEqual(1, round(timer.total_seconds()))
|
||||||
self.assertEqual(1, timer.delta.seconds)
|
self.assertEqual(1, timer.delta.seconds)
|
||||||
|
|
||||||
def test__enter_with_timeout(self):
|
def test__enter_with_timeout(self):
|
||||||
with utils.Timer(timeout=10) as timer:
|
with utils.Timer(timeout=10) as timer:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.assertEqual(1.0, round(timer.total_seconds(), 0))
|
self.assertEqual(1, round(timer.total_seconds()))
|
||||||
|
|
||||||
def test__enter_with_timeout_exception(self):
|
def test__enter_with_timeout_exception(self):
|
||||||
msg = r'Timer timeout expired after 1 second\(s\).'
|
msg = r'Timer timeout expired after 1 second\(s\).'
|
||||||
|
|
Loading…
Reference in New Issue