comparison tests/run.py @ 851:9ce00cb1d676

Merge alternate tunnel schemes.
author Augie Fackler <durin42@gmail.com>
date Sat, 25 Feb 2012 14:51:22 -0600
parents 312b37bc5e20
children d3ff5807f1bd
comparison
equal deleted inserted replaced
850:d3bc067c0f72 851:9ce00cb1d676
91 # silence output when running outside nose 91 # silence output when running outside nose
92 if not options.showstdout: 92 if not options.showstdout:
93 import tempfile 93 import tempfile
94 sys.stdout = tempfile.TemporaryFile() 94 sys.stdout = tempfile.TemporaryFile()
95 95
96 all = tests() 96 all_tests = tests()
97 97
98 args = [i.split('.py')[0].replace('-', '_') for i in args] 98 args = [i.split('.py')[0].replace('-', '_') for i in args]
99 99
100 if not args: 100 if not args:
101 check = lambda x: options.comprehensive or not comprehensive(x) 101 check = lambda x: options.comprehensive or not comprehensive(x)
102 mods = [m for (n, m) in sorted(all.iteritems()) if check(m)] 102 mods = [m for (n, m) in sorted(all_tests.iteritems()) if check(m)]
103 suite = [m.suite() for m in mods] 103 suite = [m.suite() for m in mods]
104 else: 104 else:
105 suite = [] 105 suite = []
106 for arg in args: 106 for arg in args:
107 if arg == 'test_util': 107 if arg == 'test_util':
108 continue 108 continue
109 elif arg not in all: 109 elif arg not in all_tests:
110 print >> sys.stderr, 'test module %s not available' % arg 110 print >> sys.stderr, 'test module %s not available' % arg
111 else: 111 else:
112 suite.append(all[arg].suite()) 112 suite.append(all_tests[arg].suite())
113 113
114 runner = unittest.TextTestRunner(**testargs) 114 runner = unittest.TextTestRunner(**testargs)
115 result = runner.run(unittest.TestSuite(suite)) 115 result = runner.run(unittest.TestSuite(suite))
116 if not result.wasSuccessful(): 116 if not result.wasSuccessful():
117 sys.exit(1) 117 sys.exit(1)