We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a92e72b commit 87802e2Copy full SHA for 87802e2
1 file changed
tests/unit_tests/utils/test_deprecated.py
@@ -0,0 +1,19 @@
1
+import warnings
2
+
3
+import pytest
4
5
+from blueapi.utils import deprecated
6
7
8
+def test_deprecated_annotation():
9
+ @deprecated("bar")
10
+ def foo():
11
+ return 1
12
13
+ with pytest.warns(DeprecationWarning, match="Function foo is deprecated - use bar"):
14
+ assert foo() == 1
15
16
+ # The second time a function is called, the warning should not be raised
17
+ with warnings.catch_warnings():
18
+ warnings.simplefilter("error")
19
0 commit comments