changeset 619:b4784426e4c8 pytest2

added display messages on failure in _tests/test_wikiutil
author pkumar <contactprashantat@gmail.com>
date Mon, 04 Jul 2011 15:16:56 +0530
parents add7c6c78f34
children 5b68305a8211
files MoinMoin/_tests/test_wikiutil.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Mon Jul 04 14:26:55 2011 +0530
+++ b/MoinMoin/_tests/test_wikiutil.py	Mon Jul 04 15:16:56 2011 +0530
@@ -232,13 +232,15 @@
     """  
     result = wikiutil.split_anchor('MoinMoin')
     expected = 'MoinMoin', ''
-    assert result == expected 
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
+
     result = wikiutil.split_anchor('MoinMoin#test_anchor|label|attr=val')
     expected = ['MoinMoin', 'test_anchor|label|attr=val']
-    assert result == expected
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
+
     result = wikiutil.split_anchor('#MoinMoin#')
     expected = ['#MoinMoin', '']
-    assert result == expected
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
     
 def testfile_headers():
     test_headers = [
@@ -253,12 +255,12 @@
     for test_file, content_type in test_headers:
         result = wikiutil.file_headers(test_file, None, 10)
         expected = [('Content-Type', content_type), ('Content-Length', '10')]
-        assert result == expected
+        assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
 
     # filename is none and content type has a value
     result = wikiutil.file_headers(None, 'plane/text')
     expected = [('Content-Type', 'plane/text')]
-    assert result == expected
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
         
 coverage_modules = ['MoinMoin.wikiutil']