Revision: 2413
Author: pekka.klarck
Date: Wed Dec 30 13:33:50 2009
Log: 1) fixed elapsedmillis -> elapsedtime 2) cleanup
http://code.google.com/p/robotframework/source/detail?r=2413

Modified:
 /trunk/doc/userguide/src/ExtendingRobotFramework/check_test_times.py

=======================================
--- /trunk/doc/userguide/src/ExtendingRobotFramework/check_test_times.py Fri May 30 17:53:34 2008 +++ /trunk/doc/userguide/src/ExtendingRobotFramework/check_test_times.py Wed Dec 30 13:33:50 2009
@@ -12,8 +12,7 @@


 def check_tests(inpath, outpath=None):
-    print inpath, outpath
-    if outpath is None:
+    if not outpath:
         outpath = inpath
     suite = TestSuite(inpath)
     _check_execution_times(suite)
@@ -21,7 +20,7 @@

 def _check_execution_times(suite):
     for test in suite.tests:
-        if test.status == 'PASS' and test.elapsedmillis > 1000 * 60 * 3:
+        if test.status == 'PASS' and test.elapsedtime > 1000 * 60 * 3:
             test.status = 'FAIL'
test.message = 'Test execution time was too long: %s' % test.elapsedtime
     for suite in suite.suites:
@@ -29,8 +28,7 @@


 if __name__ == '__main__':
-    if not len(sys.argv) in [2,3]:
+    try:
+        check_tests(*sys.argv[1:])
+    except TypeError:
         print __doc__
-        exit(1)
-    check_tests(*sys.argv[1:])
-

Reply via email to