Code

fixed detection of bad date specs (sf bug 691439)
[roundup.git] / test / __init__.py
1 #
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10 # POSSIBILITY OF SUCH DAMAGE.
11 #
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17
18 # $Id: __init__.py,v 1.18 2002-09-10 00:19:54 richard Exp $
20 import os, tempfile, unittest, shutil
21 import roundup.roundupdb
22 roundup.roundupdb.SENDMAILDEBUG=os.environ['SENDMAILDEBUG']=tempfile.mktemp()
24 # figure all the modules available
25 dir = os.path.split(__file__)[0]
26 test_mods = {}
27 for file in os.listdir(dir):
28     if file.startswith('test_') and file.endswith('.py'):
29         name = file[5:-3]
30         test_mods[name] = __import__(file[:-3], globals(), locals(), [])
31 all_tests = test_mods.keys()
33 def go(tests=all_tests):
34     l = []
35     for name in tests:
36         l.append(test_mods[name].suite())
37     suite = unittest.TestSuite(l)
38     runner = unittest.TextTestRunner()
39     runner.run(suite)
41 # vim: set filetype=python ts=4 sw=4 et si