Changeset 228
- Timestamp:
- 08/06/07 23:37:36 (1 year ago)
- Files:
-
- trunk/bin/domainmodel-profiletest (deleted)
- trunk/bin/domainmodel-test (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bin/domainmodel-test
r219 r228 9 9 import unittest 10 10 from optparse import OptionParser 11 import profile 11 12 12 13 os.environ['DJANGO_SETTINGS_MODULE'] = 'dm.django.settings.main' … … 30 31 help='Path to configuration file. If not provided please ensure relevant environment variable is set.' 31 32 ) 32 33 parser.add_option('-p', '--profile', 34 action='store_true', dest='profile', default=False, 35 help='Profile the performance of a test suite') 36 33 37 (options, args) = parser.parse_args() 34 38 if options.config: … … 55 59 56 60 testRunner = unittest.TextTestRunner(verbosity=options.level) 57 result = testRunner.run(testSuite) 61 if options.profile: 62 code = "result = testRunner.run(testSuite)" 63 profile.run(code) 64 else: 65 result = testRunner.run(testSuite) 66 58 67 if not result.wasSuccessful(): 59 68 sys.exit(1)
