UnitTest Framework Tutorial
UnitTest Framework Resources
Selected Reading
- Nose Testing - Tools
- Nose Testing - Framework
- UnitTest Framework - Py.test Module
- UnitTest Framework - Doctest API
- UnitTest Framework - Doctest
- UnitTest Framework - Signal Handling
- UnitTest Framework - Unittest2
- UnitTest Framework - Time Test
- UnitTest Framework - Exceptions Test
- UnitTest Framework - Skip Test
- UnitTest Framework - Test Discovery
- UnitTest Framework - Assertion
- UnitTest Framework - API
- UnitTest Framework - Framework
- UnitTest Framework - Overview
- UnitTest Framework - Home
UnitTest Framework Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
UnitTest Framework - Time Test
UnitTest Framework - Time Test
Junit, Java单位测试框架(Pyunit正在执行Junnit)有一手时间选择。 如果试验需要超过规定时间,那么试验就会被标为失败。
灰色检测框架没有包含任何时间外出的支持。 然而,第三部分单元称为临时决定员,可以从事这项工作。
• 下载和安装模块
Import timeout_decorator in the code
Put timeout decorator before the test
@timeout_decorator.timeout(10)
如果低于此线的试验方法超过了此处提及的(10分钟)时间,就会提高时间范围。 例如:
import time import timeout_decorator class timeoutTest(unittest.TestCase): @timeout_decorator.timeout(5) def testtimeout(self): print "Start" for i in range(1,10): time.sleep(1) print "%d seconds have passed" % i if __name__ == __main__ : unittest.main()Advertisements