diff options
Diffstat (limited to 'yardstick/tests/unit/common/test_utils.py')
-rw-r--r-- | yardstick/tests/unit/common/test_utils.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/yardstick/tests/unit/common/test_utils.py b/yardstick/tests/unit/common/test_utils.py index 5fd91c87f..31b10e6da 100644 --- a/yardstick/tests/unit/common/test_utils.py +++ b/yardstick/tests/unit/common/test_utils.py @@ -1174,6 +1174,17 @@ class TimerTestCase(unittest.TestCase): with utils.Timer(timeout=1): time.sleep(2) + def test__enter_with_timeout_no_exception(self): + with utils.Timer(timeout=1, raise_exception=False): + time.sleep(2) + + def test__iter(self): + iterations = [] + for i in utils.Timer(timeout=2): + iterations.append(i) + time.sleep(1.1) + self.assertEqual(2, len(iterations)) + class WaitUntilTrueTestCase(unittest.TestCase): |