Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Checkout prior commit of _doctest.py

  • Loading branch information...
commit 8f85e734581d3c63905b991fc82fe05e7a1df709 1 parent 776ee92
Ray Ashman Jr authored jasonamyers committed
Showing with 8 additions and 8 deletions.
  1. +8 −8 django/test/_doctest.py
View
16 django/test/_doctest.py
@@ -898,7 +898,7 @@ def _from_module(self, module, object):
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 @@ def __run(self, test, compileflags, out):
# 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 @@ def py3_displayhook(value):
# 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 @@ def py3_displayhook(value):
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 @@ def py3_displayhook(value):
# 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 @@ def output_difference(self, example, got, optionflags):
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.