Windows python 2.2.1 IDLE glitch - unittest output display nothing 
Author Message
 Windows python 2.2.1 IDLE glitch - unittest output display nothing

When running a script using CTRL-F5 under IDLE under windows 2000,
python 2.2.1 I find that unittests run but the resulting stderr output
does not appear at all?  For example:

import unittest, random

class TestCase00(unittest.TestCase):
    def checkA(self):
        assert 1
    def checkB(self):
        assert 0

def suite():
    suite1 = unittest.makeSuite(TestCase00,'check')
    alltests = unittest.TestSuite( (suite1,) )
    return alltests

def main():
    runner = unittest.TextTestRunner(descriptions=0, verbosity=2
    runner.run( suite() )

if __name__ == '__main__':
    print 'Gonna run some tests...'
    main()

It's as if stderr is 'lost' somewhere.  This problem does not appear
under linux 2.2.1c - only windows (I can reproduce this problem under
two versions of windows 2000.)

All my scripts with unittests thus cannot be tested using CTRL-F5 (Run
Script), which is pretty serious.  What is going on?

IDLE under the previous version python 2.1.3 works fine, as do
versions 2.1.3 & 2.2.1 of activestate pythonwin (work fine, that is).
All versions of IDLEfork 0.8.1 work ok too.  Its only the standard
IDLE with the latest python 2.2.1 under windows has this problem.

-Andy Bulka
www.atug.com/andypatterns



Wed, 10 Nov 2004 21:52:41 GMT  
 Windows python 2.2.1 IDLE glitch - unittest output display nothing

Quote:

> When running a script using CTRL-F5 under IDLE under windows 2000,
> python 2.2.1 I find that unittests run but the resulting stderr output
> does not appear at all?  

Can't help you with the problem itself, but maybe this would be
an adequate (if temporary) workaround:

# redirect stderr to stdout for unittest output... must come before
# the unittest import
import sys
sys.stderr = sys.stdout    

Quote:
> import unittest, random

> class TestCase00(unittest.TestCase):
>     def checkA(self):
>         assert 1
>     def checkB(self):
>         assert 0



Wed, 10 Nov 2004 22:23:33 GMT  
 Windows python 2.2.1 IDLE glitch - unittest output display nothing
It may work if you do "python idle.py" from a command console and leave the
console open. Don't use Pythonw since that disconnects the app from the
console.

Since Windows lacks a unified stdio for consoles and gui apps, redirection
won't work and that's why you're seeing the difference between Windows and
Linux.

David LeBlanc
Seattle, WA USA

Quote:
> -----Original Message-----


> Sent: Saturday, May 25, 2002 6:53

> Subject: Windows python 2.2.1 IDLE glitch - unittest output display
> nothing

> When running a script using CTRL-F5 under IDLE under windows 2000,
> python 2.2.1 I find that unittests run but the resulting stderr output
> does not appear at all?  For example:

> import unittest, random

> class TestCase00(unittest.TestCase):
>     def checkA(self):
>         assert 1
>     def checkB(self):
>         assert 0

> def suite():
>     suite1 = unittest.makeSuite(TestCase00,'check')
>     alltests = unittest.TestSuite( (suite1,) )
>     return alltests

> def main():
>     runner = unittest.TextTestRunner(descriptions=0, verbosity=2
>     runner.run( suite() )

> if __name__ == '__main__':
>     print 'Gonna run some tests...'
>     main()

> It's as if stderr is 'lost' somewhere.  This problem does not appear
> under linux 2.2.1c - only windows (I can reproduce this problem under
> two versions of windows 2000.)

> All my scripts with unittests thus cannot be tested using CTRL-F5 (Run
> Script), which is pretty serious.  What is going on?

> IDLE under the previous version python 2.1.3 works fine, as do
> versions 2.1.3 & 2.2.1 of activestate pythonwin (work fine, that is).
> All versions of IDLEfork 0.8.1 work ok too.  Its only the standard
> IDLE with the latest python 2.2.1 under windows has this problem.

> -Andy Bulka
> www.atug.com/andypatterns
> --
> http://mail.python.org/mailman/listinfo/python-list



Thu, 11 Nov 2004 05:31:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Just Glitch, Glitch, Glitch!

2. Python 2.1.1 install glitch (Windows binary)

3. problems redirecting unittest output to sys.stdout

4. displaying output in windows ?

5. Complete Crash on Windows NT using Python 1.6 with IDLE

6. Windows Python 2.3b2 bug? Edit with IDLE

7. python 2.2.2 install has unworking IDLE in windows 2000

8. Report preview displays NOTHING onmy system

9. NOTHING, NOTHING AT ALL!!

10. Need help Translating Python unittest to Ruby Test::Unit

11. IDLE 0.5 Function parameter display?

12. display update without beeing idle?

 

 
Powered by phpBB® Forum Software