[Zope3-checkins] SVN: zope.testing/tags/regebro-python3-reloaded/s Exceptions now fall out of scope, unless you do something about it.

Lennart Regebro regebro at gmail.com
Mon Dec 7 15:23:19 EST 2009


Log message for revision 106259:
  Exceptions now fall out of scope, unless you do something about it.
  

Changed:
  U   zope.testing/tags/regebro-python3-reloaded/setup.py
  U   zope.testing/tags/regebro-python3-reloaded/src/zope/testing/doctest.py

-=-
Modified: zope.testing/tags/regebro-python3-reloaded/setup.py
===================================================================
--- zope.testing/tags/regebro-python3-reloaded/setup.py	2009-12-07 20:22:56 UTC (rev 106258)
+++ zope.testing/tags/regebro-python3-reloaded/setup.py	2009-12-07 20:23:18 UTC (rev 106259)
@@ -122,7 +122,7 @@
         scriptfile.close()
  
         import subprocess
-        process = subprocess.Popen([sys.executable, filename])
+        process = subprocess.Popen([sys.executable, filename, '-c'])
         process.wait()
         os.unlink(filename)
     

Modified: zope.testing/tags/regebro-python3-reloaded/src/zope/testing/doctest.py
===================================================================
--- zope.testing/tags/regebro-python3-reloaded/src/zope/testing/doctest.py	2009-12-07 20:22:56 UTC (rev 106258)
+++ zope.testing/tags/regebro-python3-reloaded/src/zope/testing/doctest.py	2009-12-07 20:23:18 UTC (rev 106259)
@@ -1769,10 +1769,11 @@
          >>> runner = DebugRunner(verbose=False)
          >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
          ...                                    {}, 'foo', 'foo.py', 0)
+         >>> failure = None
          >>> try:
          ...     runner.run(test)
-         ... except UnexpectedException, failure:
-         ...     pass
+         ... except UnexpectedException, e:
+         ...     failure = e
 
          >>> failure.test is test
          True
@@ -1797,10 +1798,11 @@
          ...      2
          ...      ''', {}, 'foo', 'foo.py', 0)
 
+         >>> failure = None
          >>> try:
          ...    runner.run(test)
-         ... except DocTestFailure, failure:
-         ...    pass
+         ... except DocTestFailure, e:
+         ...    failure = None
 
        DocTestFailure objects provide access to the test:
 
@@ -2373,10 +2375,11 @@
              >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
              ...                {}, 'foo', 'foo.py', 0)
              >>> case = DocTestCase(test)
+             >>> failure = None
              >>> try:
              ...     case.debug()
-             ... except UnexpectedException, failure:
-             ...     pass
+             ... except UnexpectedException, e:
+             ...     failure = e
 
            The UnexpectedException contains the test, the example, and
            the original exception:
@@ -2402,10 +2405,11 @@
              ...      ''', {}, 'foo', 'foo.py', 0)
              >>> case = DocTestCase(test)
 
+             >>> failure = None
              >>> try:
              ...    case.debug()
-             ... except DocTestFailure, failure:
-             ...    pass
+             ... except DocTestFailure, e:
+             ...    failure = e
 
            DocTestFailure objects provide access to the test:
 



More information about the Zope3-Checkins mailing list