[Checkins] SVN: zope.exceptions/trunk/src/zope/exceptions/tests/test_exceptionformatter.py Fix test failure under Python 2.6.

Marius Gedminas cvs-admin at zope.org
Wed Dec 19 14:31:34 UTC 2012


Log message for revision 128776:
  Fix test failure under Python 2.6.
  
  The code was correct, the test incorrectly assumed exec 'foo =' would cause
  the same kind of SyntaxError under all Python versions.  That turned out not to
  be the case.
  
  

Changed:
  U   zope.exceptions/trunk/src/zope/exceptions/tests/test_exceptionformatter.py

-=-
Modified: zope.exceptions/trunk/src/zope/exceptions/tests/test_exceptionformatter.py
===================================================================
--- zope.exceptions/trunk/src/zope/exceptions/tests/test_exceptionformatter.py	2012-12-19 11:12:42 UTC (rev 128775)
+++ zope.exceptions/trunk/src/zope/exceptions/tests/test_exceptionformatter.py	2012-12-19 14:31:33 UTC (rev 128776)
@@ -791,16 +791,16 @@
 
         >>> from zope.exceptions.exceptionformatter import format_exception
         >>> try:
-        ...     exec 'foo = '
+        ...     exec 'import 2 + 2'
         ... except:
         ...     print ''.join(format_exception(*sys.exc_info(), as_html=True)),
         <p>Traceback (most recent call last):</p>
         <ul>
         <li>  Module zope.exceptions.tests.test_exceptionformatter, line 2, in &lt;module&gt;<br />
-            exec 'foo = '</li>
+            exec 'import 2 + 2'</li>
         </ul><p>  File "&lt;string&gt;", line 1<br />
-            foo =<br />
-                 ^<br />
+            import 2 + 2<br />
+                   ^<br />
         SyntaxError: invalid syntax<br />
         </p>
 



More information about the checkins mailing list