You can either use pipe the stdout through tee to save it in a file too,
or in a more pythonic way define a file-like object that prints to stdout as you write to it:

import sys
class PrintStream(object):
    def __init__(self, file):
        self.out = file
    def write(self, b):
        self.out.write(b)
        sys.stdout.write(b)


unittest.TextTestRunner(PrintStream(file),verbosity=2).run(suite)

Hope that helped,
Orestis


Deepali Abhyankar wrote:
Hi

I used following code to write result on different media.

unittest.TextTestRunner(verbosity=2).run(suite) : Writes result to StdOutput
unittest.TextTestRunner(file,verbosity=2).run(suite) : Writes result to file


But what should I do to write test result on file as well as StdOutput, on
single go?
Is there any other method to do this?

Regards
Deepali


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeff Hardy
Sent: Friday, December 05, 2008 7:27 AM
To: Discussion of IronPython; [EMAIL PROTECTED]
Subject: [IronPython] NWSGI 0.7 released

NWSGI 0.7 is now available. This version adds support for ASP.NET
sessions, fixes Unicode handling, and adds support for wildcard
mappings. It is available at
http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189.

What is NWSGI?
NWSGI is an ASP.NET HttpHandler that implements the Python WSGI spec
(PEP 333 - http://www.python.org/dev/peps/pep-0333/) for interfacing
web servers and web frameworks using IronPython. There are still some
IronPYthon bugs that prevent everything from working, but some things
do.

For more details on this release, see
http://jdhardy.blogspot.com/2008/12/nwsgi-07-released.html.

- Jeff
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

--
Orestis Markou
Software Engineer,
Resolver Systems Ltd.
[EMAIL PROTECTED]
+44 (0) 20 7253 6372

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to