diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-12 19:44:37 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-12 19:50:15 -0400 |
commit | 993e6449e3f5f3532f6f5426b824718435ce6c6d (patch) | |
tree | d60617a832091e4fc62e6e100932a1f955f9d7cf /lib/sqlalchemy/testing/warnings.py | |
parent | 4b3a68e91c73ae84a3719d6933dc991ec2453d5b (diff) | |
download | sqlalchemy-993e6449e3f5f3532f6f5426b824718435ce6c6d.tar.gz |
Dont raise on pytest deprecation warnings
py.test 5.4.0 emits deprecation warnings for pytest.Class.
make sure we don't raise for these, and log the code that will
be used for 5.4.0 when we bump requirements.
Fixes: #5201
Change-Id: I83e0402c4a6b2365a63b58d052c6989df3a37328
Diffstat (limited to 'lib/sqlalchemy/testing/warnings.py')
-rw-r--r-- | lib/sqlalchemy/testing/warnings.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py index cc11e556c..6b42c98cb 100644 --- a/lib/sqlalchemy/testing/warnings.py +++ b/lib/sqlalchemy/testing/warnings.py @@ -34,6 +34,15 @@ def setup_filters(): # ignore 2.0 warnings unless we are explicitly testing for them warnings.filterwarnings("ignore", category=sa_exc.RemovedIn20Warning) + try: + import pytest + except ImportError: + pass + else: + warnings.filterwarnings( + "once", category=pytest.PytestDeprecationWarning + ) + def assert_warnings(fn, warning_msgs, regex=False): """Assert that each of the given warnings are emitted by fn. |