From 8f85e734581d3c63905b991fc82fe05e7a1df709 Mon Sep 17 00:00:00 2001 From: Ray Ashman Jr Date: Sat, 2 Nov 2013 20:20:53 -0400 Subject: [PATCH] Checkout prior commit of _doctest.py --- django/test/_doctest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/django/test/_doctest.py b/django/test/_doctest.py index 2b90f1dc2e..048d886720 100644 --- a/django/test/_doctest.py +++ b/django/test/_doctest.py @@ -898,7 +898,7 @@ class DocTestFinder: elif hasattr(object, '__module__'): return module.__name__ == object.__module__ elif isinstance(object, property): - return True # [XX] no way not be sure. + return True # [XX] no way not be sure. else: raise ValueError("object must be a class or function") @@ -1221,7 +1221,7 @@ class DocTestRunner: # to modify them). original_optionflags = self.optionflags - SUCCESS, FAILURE, BOOM = range(3) # `outcome` state + SUCCESS, FAILURE, BOOM = range(3) # `outcome` state check = self._checker.check_output @@ -1274,7 +1274,7 @@ class DocTestRunner: # Strip b"" and u"" prefixes from the repr and expected output # TODO: better way of stripping the prefixes? expected = example.want - expected = expected.strip() # be wary of newlines + expected = expected.strip() # be wary of newlines s = s.replace("u", "") s = s.replace("b", "") expected = expected.replace("u", "") @@ -1288,7 +1288,7 @@ class DocTestRunner: lines.append(s) # let them match - if s == expected: # be wary of false positives here + if s == expected: # be wary of false positives here # they should be the same, print expected value sys.stdout.write("%s\n" % example.want.strip()) @@ -1314,13 +1314,13 @@ class DocTestRunner: # Don't blink! This is where the user's code gets run. six.exec_(compile(example.source, filename, "single", compileflags, 1), test.globs) - self.debugger.set_continue() # ==== Example Finished ==== + self.debugger.set_continue() # ==== Example Finished ==== exception = None except KeyboardInterrupt: raise except: exception = sys.exc_info() - self.debugger.set_continue() # ==== Example Finished ==== + self.debugger.set_continue() # ==== Example Finished ==== finally: # restore the original displayhook sys.displayhook = original_displayhook @@ -1647,11 +1647,11 @@ class OutputChecker: # Use difflib to find their differences. if optionflags & REPORT_UDIFF: diff = difflib.unified_diff(want_lines, got_lines, n=2) - diff = list(diff)[2:] # strip the diff header + diff = list(diff)[2:] # strip the diff header kind = 'unified diff with -expected +actual' elif optionflags & REPORT_CDIFF: diff = difflib.context_diff(want_lines, got_lines, n=2) - diff = list(diff)[2:] # strip the diff header + diff = list(diff)[2:] # strip the diff header kind = 'context diff with expected followed by actual' elif optionflags & REPORT_NDIFF: engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)