~ubuntu-branches/ubuntu/hardy/zope-resourceregistries/hardy

« back to all changes in this revision

Viewing changes to tests/runalltests.py

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2007-02-09 15:47:40 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070209154740-xj4dvowhvxhhzrlm
Tags: 1.3.4-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Runs all tests in the current directory
3
 
#
4
 
# Execute like:
5
 
#   python runalltests.py
6
 
#
7
 
# Alternatively use the testrunner: 
8
 
#   python /path/to/Zope/utilities/testrunner.py -qa
9
 
#
10
 
 
11
 
import os, sys
12
 
if __name__ == '__main__':
13
 
    execfile(os.path.join(sys.path[0], 'framework.py')) 
14
 
 
15
 
import unittest
16
 
TestRunner = unittest.TextTestRunner
17
 
suite = unittest.TestSuite()
18
 
 
19
 
tests = os.listdir(os.curdir)
20
 
tests = [n[:-3] for n in tests if n.startswith('test') and n.endswith('.py')]
21
 
 
22
 
for test in tests:
23
 
    m = __import__(test)
24
 
    if hasattr(m, 'test_suite'):
25
 
        suite.addTest(m.test_suite())
26
 
 
27
 
if __name__ == '__main__':
28
 
    TestRunner().run(suite)
29