From ddd5203195376a5cfdd675f0281b5766cc4e827d 2010-01-13 07:42:28 From: Fernando Perez Date: 2010-01-13 07:42:28 Subject: [PATCH] Fix the two Twisted trial errors under win32. I had incorrectly used a nose decorator instead of the twisted approach. --- diff --git a/IPython/kernel/core/tests/test_redirectors.py b/IPython/kernel/core/tests/test_redirectors.py index 57d103c..fe48371 100644 --- a/IPython/kernel/core/tests/test_redirectors.py +++ b/IPython/kernel/core/tests/test_redirectors.py @@ -18,18 +18,19 @@ __test__ = {} from cStringIO import StringIO import os +import sys from twisted.trial import unittest -from IPython.testing import decorators as dec - #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- class TestRedirector(unittest.TestCase): - @dec.skip_win32 + if sys.platform == 'win32': + skip = True + def test_redirector(self): """Checks that the redirector can be used to do synchronous capture. """ @@ -50,7 +51,6 @@ class TestRedirector(unittest.TestCase): result2 = "".join("%ic\n%i\n" %(i, i) for i in range(10)) self.assertEquals(result1, result2) - @dec.skip_win32 def test_redirector_output_trap(self): """Check the greedy trapping behavior of the traps. @@ -58,7 +58,8 @@ class TestRedirector(unittest.TestCase): trap the output, but also that it does it in a gready way, that is by calling the callback ASAP. """ - from IPython.kernel.core.redirector_output_trap import RedirectorOutputTrap + from IPython.kernel.core.redirector_output_trap import \ + RedirectorOutputTrap out = StringIO() trap = RedirectorOutputTrap(out.write, out.write) try: