aboutsummaryrefslogtreecommitdiff
path: root/tests/test_pandora/test_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pandora/test_util.py')
-rw-r--r--tests/test_pandora/test_util.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_pandora/test_util.py b/tests/test_pandora/test_util.py
new file mode 100644
index 0000000..2b4ca83
--- /dev/null
+++ b/tests/test_pandora/test_util.py
@@ -0,0 +1,22 @@
1import warnings
2from unittest import TestCase
3from pandora.py2compat import patch
4
5from pandora import util
6
7
8class TestDeprecatedWarning(TestCase):
9
10 def test_warning(self):
11 class Bar(object):
12
13 @util.deprecated("1.0", "2.0", "Don't use this")
14 def foo(self):
15 pass
16
17 with patch.object(warnings, "warn") as wmod:
18 Bar().foo()
19
20 wmod.assert_called_with(
21 ("foo is deprecated as of version 1.0 and will be removed in "
22 "version 2.0. Don't use this"), DeprecationWarning)