"round" with ndigits=None returns an integer
Trivial-Fix Change-Id: Ic21e34462aabd5cc2aa879ec4f47e2b1bc1dd934
This commit is contained in:
parent
b7fbb74b46
commit
cb2ebcc998
@ -544,13 +544,13 @@ class TimerTestCase(base.BaseTestCase):
|
||||
def test__getattr(self):
|
||||
with utils.Timer() as timer:
|
||||
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)
|
||||
|
||||
def test__enter_with_timeout(self):
|
||||
with utils.Timer(timeout=10) as timer:
|
||||
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):
|
||||
msg = r'Timer timeout expired after 1 second\(s\).'
|
||||
|
Loading…
x
Reference in New Issue
Block a user