diff options
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 10 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/profiling.py | 17 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/warnings.py | 7 |
3 files changed, 10 insertions, 24 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 795b53804..978e6764f 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -31,7 +31,7 @@ from ..util import decorator def expect_warnings(*messages, **kw): """Context manager which expects one or more warnings. - With no arguments, squelches all SAWarning and RemovedIn20Warning emitted via + With no arguments, squelches all SAWarning emitted via sqlalchemy.util.warn and sqlalchemy.util.warn_limited. Otherwise pass string expressions that will match selected warnings via regex; all non-matching warnings are sent through. @@ -41,9 +41,7 @@ def expect_warnings(*messages, **kw): Note that the test suite sets SAWarning warnings to raise exceptions. """ # noqa - return _expect_warnings( - (sa_exc.RemovedIn20Warning, sa_exc.SAWarning), messages, **kw - ) + return _expect_warnings(sa_exc.SAWarning, messages, **kw) @contextlib.contextmanager @@ -199,9 +197,7 @@ def _expect_warnings( else: real_warn(msg, *arg, **kw) - with mock.patch("warnings.warn", our_warn), mock.patch( - "sqlalchemy.util.SQLALCHEMY_WARN_20", True - ), mock.patch("sqlalchemy.util.deprecations.SQLALCHEMY_WARN_20", True): + with mock.patch("warnings.warn", our_warn): try: yield finally: diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py index 2761d4987..6ccfe4ea7 100644 --- a/lib/sqlalchemy/testing/profiling.py +++ b/lib/sqlalchemy/testing/profiling.py @@ -238,21 +238,18 @@ def function_call_count(variance=0.05, times=1, warmup=0): # likely due to the introduction of __signature__. from sqlalchemy.util import decorator - from sqlalchemy.util import deprecations - from sqlalchemy.testing import mock @decorator def wrap(fn, *args, **kw): - with mock.patch.object(deprecations, "SQLALCHEMY_WARN_20", False): - for warm in range(warmup): - fn(*args, **kw) + for warm in range(warmup): + fn(*args, **kw) - timerange = range(times) - with count_functions(variance=variance): - for time in timerange: - rv = fn(*args, **kw) - return rv + timerange = range(times) + with count_functions(variance=variance): + for time in timerange: + rv = fn(*args, **kw) + return rv return wrap diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py index c8e481a90..0c550731c 100644 --- a/lib/sqlalchemy/testing/warnings.py +++ b/lib/sqlalchemy/testing/warnings.py @@ -46,13 +46,6 @@ def setup_filters(): message="The loop argument is deprecated", ) - # ignore things that are deprecated *as of* 2.0 :) - warnings.filterwarnings( - "ignore", - category=sa_exc.SADeprecationWarning, - message=r".*\(deprecated since: 2.0\)$", - ) - try: import pytest except ImportError: |
