File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,14 @@ markers =
7
7
slow: marks tests as slow (deselect with ' -m "not slow"' )
8
8
log_cli = 1
9
9
log_cli_level = INFO
10
+ filterwarnings =
11
+ error
12
+ # From our own tests
13
+ ignore:__init__ is deprecated and will be removed in a future release:DeprecationWarning
14
+ ignore:deprecated_function is deprecated and will be removed in a future release, please use replacement_function:DeprecationWarning
15
+ # Python 3.7 deprecation
16
+ ignore::boto3.exceptions.PythonDeprecationWarning
17
+ # https://github.com/pytest-dev/pytest-xdist/issues/825#issuecomment-1292450429
18
+ ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning
19
+ # Pytest warnings
20
+ ignore::pytest.PytestUnraisableExceptionWarning
Original file line number Diff line number Diff line change 1
- import warnings
2
1
from unittest import TestCase
3
2
3
+ import pytest
4
4
from samtranslator .internal .deprecation_control import deprecated
5
5
6
6
@@ -15,12 +15,5 @@ def deprecated_function(x, y):
15
15
16
16
class TestDeprecationControl (TestCase ):
17
17
def test_deprecated_decorator (self ):
18
- with warnings . catch_warnings ( record = True ) as w :
18
+ with pytest . warns ( DeprecationWarning ) :
19
19
deprecated_function (1 , 1 )
20
- self .assertEqual (len (w ), 1 )
21
- self .assertTrue (issubclass (w [- 1 ].category , DeprecationWarning ))
22
- self .assertIn (
23
- "deprecated_function is deprecated and will be removed in a future release, "
24
- "please use replacement_function" ,
25
- str (w [- 1 ].message ),
26
- )
You can’t perform that action at this time.
0 commit comments