[py-svn] r36972 - py/dist/py/test/rsession

guido at codespeak.net guido at codespeak.net
Thu Jan 18 21:35:23 CET 2007


Author: guido
Date: Thu Jan 18 21:35:14 2007
New Revision: 36972

Modified:
   py/dist/py/test/rsession/rsession.py
Log:
Capturing stdout while running tests, and printing message to stderr.


Modified: py/dist/py/test/rsession/rsession.py
==============================================================================
--- py/dist/py/test/rsession/rsession.py	(original)
+++ py/dist/py/test/rsession/rsession.py	Thu Jan 18 21:35:14 2007
@@ -285,11 +285,22 @@
         if self.config.option.apigen:
             from py.__.apigen.tracer.docstorage import DocStorageAccessor
             apigen = py.path.local(self.config.option.apigen).pyimport()
+            print >>sys.stderr, 'building documentation'
+            capture = py.io.OutErrCapture()
             try:
-                apigen.build(pkgdir, DocStorageAccessor(self.docstorage))
-            except (ValueError, AttributeError):
-                raise NotImplementedError("Provided script does not seem "
-                                          "to contain build function")
+                try:
+                    apigen.build(pkgdir, DocStorageAccessor(self.docstorage))
+                except (ValueError, AttributeError):
+                    #import traceback
+                    #exc, e, tb = sys.exc_info()
+                    #print '%s - %s' % (exc, e)
+                    #print ''.join(traceback.format_tb(tb))
+                    #del tb
+                    #print '-' * 79
+                    raise NotImplementedError("Provided script does not seem "
+                                              "to contain build function")
+            finally:
+                capture.reset()
 
     def init_runner(self, pkgdir):
         if self.config.option.apigen:



More information about the pytest-commit mailing list