Changeset 2253
- Timestamp:
- 02/03/06 17:24:20 (3 years ago)
- Files:
-
- django/branches/magic-removal/tests/runtests.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/tests/runtests.py
r2035 r2253 40 40 41 41 def report_unexpected_exception(self, out, test, example, exc_info): 42 from django.db import connection 42 43 tb = ''.join(traceback.format_exception(*exc_info)[1:]) 43 44 log_error(test.name, "API test raised an exception", 44 45 "Code: %r\nLine: %s\nException: %s" % (example.source.strip(), example.lineno, tb)) 46 # Rollback, in case of database errors. Otherwise they'd have 47 # side effects on other tests. 48 connection.rollback() 45 49 46 50 normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s) … … 145 149 runner = DjangoDoctestRunner(verbosity_level=verbosity_level, verbose=False) 146 150 self.output(1, "%s model: Running tests" % model_name) 147 try: 148 runner.run(dtest, clear_globs=True, out=sys.stdout.write) 149 finally: 150 # Rollback, in case of database errors. Otherwise they'd have 151 # side effects on other tests. 152 connection.rollback() 151 runner.run(dtest, clear_globs=True, out=sys.stdout.write) 153 152 154 153 if not self.which_tests:
