timeout.py 458 B

123456789101112131415161718192021
  1. #
  2. # Copyright (C) 2016 Intel Corporation
  3. #
  4. # SPDX-License-Identifier: MIT
  5. #
  6. from time import sleep
  7. from oeqa.core.case import OETestCase
  8. from oeqa.core.decorator.oetimeout import OETimeout
  9. class TimeoutTest(OETestCase):
  10. @OETimeout(1)
  11. def testTimeoutPass(self):
  12. self.assertTrue(True, msg='How is this possible?')
  13. @OETimeout(1)
  14. def testTimeoutFail(self):
  15. sleep(2)
  16. self.assertTrue(True, msg='How is this possible?')