Debian Codegraph @

traits/testing/tests/test_nose_tools.py

raw
1 # (C) Copyright 2005-2023 Enthought, Inc., Austin, TX
2 # All rights reserved.
3 #
4 # This software is provided without warranty under the terms of the BSD
5 # license included in LICENSE.txt and may be redistributed only under
6 # the conditions described in the aforementioned license. The license
7 # is also available online at http://www.enthought.com/licenses/BSD.txt
8 #
9 # Thanks for using Enthought open source!
10
11 import unittest
12
13 from traits.testing.nose_tools import deprecated, performance, skip
14
15
16 class TestNoseTools(unittest.TestCase):
17 def test_deprecated_deprecated(self):
18 with self.assertWarns(DeprecationWarning) as cm:
19
20 @deprecated
21 def some_func():
22 pass
23
24 self.assertIn("test_nose_tools", cm.filename)
25
26 def test_performance_deprecated(self):
27 with self.assertWarns(DeprecationWarning) as cm:
28
29 @performance
30 def some_func():
31 pass
32
33 self.assertIn("test_nose_tools", cm.filename)
34
35 def test_skip_deprecated(self):
36 with self.assertWarns(DeprecationWarning) as cm:
37
38 @skip
39 def some_func():
40 pass
41
42 self.assertIn("test_nose_tools", cm.filename)