changeset 259:0c25ccdc8f37

Fixed tests system for cases where request.write was redirected. Breaks test running for most situations where sys.stdout is not usable. But we do not support those currently anyway (multithreading). imported from: moin--main--1.5--patch-262
author Alexander Schremmer <alex@alexanderweb.de.tla>
date Thu, 01 Dec 2005 22:21:30 +0000
parents 5129ca4f97a7
children 3d8df5b91504
files MoinMoin/_tests/__init__.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/__init__.py	Wed Nov 30 18:46:53 2005 +0000
+++ b/MoinMoin/_tests/__init__.py	Thu Dec 01 22:21:30 2005 +0000
@@ -41,6 +41,8 @@
 @license: GNU GPL, see COPYING for details.
 """
 
+import sys
+
 from unittest import TestLoader, TextTestRunner
 
 
@@ -182,4 +184,7 @@
         request.user = User(request)
         
     suite = makeSuite(request, names)
-    TextTestRunner(stream=request, verbosity=2).run(suite)
+    
+    # do not redirect the stream to request here because request.write can
+    # be invalid or broken because not all redirections of it use a finally: block
+    TextTestRunner(stream=sys.stdout, verbosity=2).run(suite)