Changeset 465
- Timestamp:
- 08/10/05 13:00:52 (3 years ago)
- Files:
-
- django/trunk/tests/runtests.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/runtests.py
r463 r465 28 28 self.verbosity_level = verbosity_level 29 29 doctest.DocTestRunner.__init__(self, *args, **kwargs) 30 self._checker = DjangoDoctestOutputChecker() 30 31 31 32 def report_start(self, out, test, example): … … 41 42 log_error(test.name, "API test raised an exception", 42 43 "Code: %r\nLine: %s\nException: %s" % (example.source.strip(), example.lineno, tb)) 44 45 class DjangoDoctestOutputChecker(doctest.OutputChecker): 46 def check_output(self, want, got, optionflags): 47 ok = doctest.OutputChecker.check_output(self, want, got, optionflags) 48 if not ok and (want.strip().endswith("L") or got.strip().endswith("L")): 49 try: 50 return long(want.strip()) == long(got.strip()) 51 except ValueError: 52 return False 53 return ok 43 54 44 55 class TestRunner:
