Rev 194: Modified assertDocTest to show a diff when differences exist. in http://bzr.daniel-watkins.co.uk/pqm/ui

Daniel Watkins daniel at daniel-watkins.co.uk
Thu Jul 10 13:16:11 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/ui

------------------------------------------------------------
revno: 194
revision-id: daniel at daniel-watkins.co.uk-20080710121458-dnmunn1cr281vbp0
parent: daniel at daniel-watkins.co.uk-20080710103434-txpabfx46dqnkg2u
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: ui
timestamp: Thu 2008-07-10 13:14:58 +0100
message:
  Modified assertDocTest to show a diff when differences exist.
-------------- next part --------------
=== modified file 'pqm/ui/tests/test_twisted.py'
--- a/pqm/ui/tests/test_twisted.py	2006-07-26 06:47:58 +0000
+++ b/pqm/ui/tests/test_twisted.py	2008-07-10 12:14:58 +0000
@@ -50,11 +50,11 @@
 
     def assertDocTest(self, expected, actual):
         """Run a doctest output comparison."""
-        from doctest import OutputChecker, ELLIPSIS, Example
+        from doctest import OutputChecker, ELLIPSIS, Example, REPORT_NDIFF
         checker = OutputChecker()
         if not checker.check_output(expected, actual, ELLIPSIS):
             self.fail('Doctest comparison failed: %s' % 
-                      checker.output_difference(Example('', expected), actual, ELLIPSIS))
+                      checker.output_difference(Example('', expected), actual, ELLIPSIS | REPORT_NDIFF))
 
     def testSlash(self):
         # This test tests the appearance of the / web page in the web ui.



More information about the bazaar-commits mailing list