Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Checkout prior commit of _doctest.py

  • Loading branch information...
commit 8f85e734581d3c63905b991fc82fe05e7a1df709 1 parent 776ee92
Ray Ashman authored November 02, 2013 jasonamyers committed November 02, 2013

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  django/test/_doctest.py
16  django/test/_doctest.py
@@ -898,7 +898,7 @@ def _from_module(self, module, object):
898 898
         elif hasattr(object, '__module__'):
899 899
             return module.__name__ == object.__module__
900 900
         elif isinstance(object, property):
901  
-            return True # [XX] no way not be sure.
  901
+            return True  # [XX] no way not be sure.
902 902
         else:
903 903
             raise ValueError("object must be a class or function")
904 904
 
@@ -1221,7 +1221,7 @@ def __run(self, test, compileflags, out):
1221 1221
         # to modify them).
1222 1222
         original_optionflags = self.optionflags
1223 1223
 
1224  
-        SUCCESS, FAILURE, BOOM = range(3) # `outcome` state
  1224
+        SUCCESS, FAILURE, BOOM = range(3)  # `outcome` state
1225 1225
 
1226 1226
         check = self._checker.check_output
1227 1227
 
@@ -1274,7 +1274,7 @@ def py3_displayhook(value):
1274 1274
                     # Strip b"" and u"" prefixes from the repr and expected output
1275 1275
                     # TODO: better way of stripping the prefixes?
1276 1276
                     expected = example.want
1277  
-                    expected = expected.strip() # be wary of newlines
  1277
+                    expected = expected.strip()  # be wary of newlines
1278 1278
                     s = s.replace("u", "")
1279 1279
                     s = s.replace("b", "")
1280 1280
                     expected = expected.replace("u", "")
@@ -1288,7 +1288,7 @@ def py3_displayhook(value):
1288 1288
                     lines.append(s)
1289 1289
 
1290 1290
                     # let them match
1291  
-                    if s == expected: # be wary of false positives here
  1291
+                    if s == expected:  # be wary of false positives here
1292 1292
                         # they should be the same, print expected value
1293 1293
                         sys.stdout.write("%s\n" % example.want.strip())
1294 1294
 
@@ -1314,13 +1314,13 @@ def py3_displayhook(value):
1314 1314
                 # Don't blink!  This is where the user's code gets run.
1315 1315
                 six.exec_(compile(example.source, filename, "single",
1316 1316
                              compileflags, 1), test.globs)
1317  
-                self.debugger.set_continue() # ==== Example Finished ====
  1317
+                self.debugger.set_continue()  # ==== Example Finished ====
1318 1318
                 exception = None
1319 1319
             except KeyboardInterrupt:
1320 1320
                 raise
1321 1321
             except:
1322 1322
                 exception = sys.exc_info()
1323  
-                self.debugger.set_continue() # ==== Example Finished ====
  1323
+                self.debugger.set_continue()  # ==== Example Finished ====
1324 1324
             finally:
1325 1325
                 # restore the original displayhook
1326 1326
                 sys.displayhook = original_displayhook
@@ -1647,11 +1647,11 @@ def output_difference(self, example, got, optionflags):
1647 1647
             # Use difflib to find their differences.
1648 1648
             if optionflags & REPORT_UDIFF:
1649 1649
                 diff = difflib.unified_diff(want_lines, got_lines, n=2)
1650  
-                diff = list(diff)[2:] # strip the diff header
  1650
+                diff = list(diff)[2:]  # strip the diff header
1651 1651
                 kind = 'unified diff with -expected +actual'
1652 1652
             elif optionflags & REPORT_CDIFF:
1653 1653
                 diff = difflib.context_diff(want_lines, got_lines, n=2)
1654  
-                diff = list(diff)[2:] # strip the diff header
  1654
+                diff = list(diff)[2:]  # strip the diff header
1655 1655
                 kind = 'context diff with expected followed by actual'
1656 1656
             elif optionflags & REPORT_NDIFF:
1657 1657
                 engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)

0 notes on commit 8f85e73

Please sign in to comment.
Something went wrong with that request. Please try again.