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

Lennart Regebro <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <20091207202319.038AC9417F__25773.3269165785$1260217453$gmane$org@cvs.zope.org>
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:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.