diff --git a/scripts/supybot-test b/scripts/supybot-test index 2bec1826e..c0a500713 100644 --- a/scripts/supybot-test +++ b/scripts/supybot-test @@ -2,6 +2,7 @@ ### # Copyright (c) 2002-2005, Jeremiah Fincher +# Copyright (c) 2011, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -122,9 +123,10 @@ if __name__ == '__main__': parser.add_option('-c', '--clean', action='store_true', default=False, dest='clean', help='Cleans the various data/conf/logs' 'directories before running tests.') - parser.add_option('-t', '--timeout', action='store', type='int', + parser.add_option('-t', '--timeout', action='store', type='float', dest='timeout', - help='Sets the timeout for tests to return responses.') + help='Sets the timeout, in seconds, for tests to return ' + 'responses.') parser.add_option('-v', '--verbose', action='store_true', default=False, help='Sets the verbose flag, logging extra information ' 'about each test that runs.') diff --git a/src/test.py b/src/test.py index 50dad08a7..a9f716264 100644 --- a/src/test.py +++ b/src/test.py @@ -1,5 +1,6 @@ ### # Copyright (c) 2002-2005, Jeremiah Fincher +# Copyright (c) 2011, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -54,6 +55,8 @@ network = True # This is the global list of suites that are to be run. suites = [] +timeout = 10 + originalCallbacksGetHelp = callbacks.getHelp lastGetHelp = 'x' * 1000 def cachingGetHelp(method, name=None, doc=None): @@ -110,12 +113,12 @@ class PluginTestCase(SupyTestCase): """Subclass this to write a test case for a plugin. See plugins/Plugin/test.py for an example. """ - timeout = 10 plugins = None cleanConfDir = True cleanDataDir = True config = {} def __init__(self, methodName='runTest'): + self.timeout = timeout originalRunTest = getattr(self, methodName) def runTest(self): run = True