##// END OF EJS Templates
Remove redundant decorators and unify into decorators.py
Fernando Perez -
Show More
@@ -1,52 +1,57 b''
1 # encoding: utf-8
1 # encoding: utf-8
2 """
2 """
3 Tests for decorators_trial.py
3 Tests for decorators.py compatibility with Twisted.trial
4 """
4 """
5
5
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
7 # Copyright (C) 2008-2009 The IPython Development Team
7 # Copyright (C) 2008-2009 The IPython Development Team
8 #
8 #
9 # Distributed under the terms of the BSD License. The full license is in
9 # Distributed under the terms of the BSD License. The full license is in
10 # the file COPYING, distributed as part of this software.
10 # the file COPYING, distributed as part of this software.
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12
12
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14 # Imports
14 # Imports
15 #-----------------------------------------------------------------------------
15 #-----------------------------------------------------------------------------
16
16
17 # Tell nose to skip this module
17 # Tell nose to skip this module, since this is for twisted only
18 __test__ = {}
18 __test__ = {}
19
19
20 import os
20 import os
21 import sys
21 import sys
22
22
23 from twisted.trial import unittest
23 from twisted.trial import unittest
24 import IPython.testing.decorators_trial as dec
24 import IPython.testing.decorators as dec
25
25
26 #-----------------------------------------------------------------------------
26 #-----------------------------------------------------------------------------
27 # Tests
27 # Tests
28 #-----------------------------------------------------------------------------
28 #-----------------------------------------------------------------------------
29
29
30 # Note: this code is identical to that in test_decorators, but that one uses
31 # stdlib unittest, not the one from twisted, which we are using here. While
32 # somewhat redundant, we want to check both with the stdlib and with twisted,
33 # so the duplication is OK.
34
30 class TestDecoratorsTrial(unittest.TestCase):
35 class TestDecoratorsTrial(unittest.TestCase):
31
36
32 @dec.skip()
37 @dec.skip()
33 def test_deliberately_broken(self):
38 def test_deliberately_broken(self):
34 """A deliberately broken test - we want to skip this one."""
39 """A deliberately broken test - we want to skip this one."""
35 1/0
40 1/0
36
41
37 @dec.skip('Testing the skip decorator')
42 @dec.skip('Testing the skip decorator')
38 def test_deliberately_broken2(self):
43 def test_deliberately_broken2(self):
39 """Another deliberately broken test - we want to skip this one."""
44 """Another deliberately broken test - we want to skip this one."""
40 1/0
45 1/0
41
46
42 @dec.skip_linux
47 @dec.skip_linux
43 def test_linux(self):
48 def test_linux(self):
44 self.assertNotEquals(sys.platform,'linux2',"This test can't run under linux")
49 self.assertNotEquals(sys.platform,'linux2',"This test can't run under linux")
45
50
46 @dec.skip_win32
51 @dec.skip_win32
47 def test_win32(self):
52 def test_win32(self):
48 self.assertNotEquals(sys.platform,'win32',"This test can't run under windows")
53 self.assertNotEquals(sys.platform,'win32',"This test can't run under windows")
49
54
50 @dec.skip_osx
55 @dec.skip_osx
51 def test_osx(self):
56 def test_osx(self):
52 self.assertNotEquals(sys.platform,'darwin',"This test can't run under osx") No newline at end of file
57 self.assertNotEquals(sys.platform,'darwin',"This test can't run under osx")
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now