summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/assertions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-05-20 13:41:44 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-21 14:16:03 -0400
commit4550983e0ce2f35b3585e53894c941c23693e71d (patch)
tree3928e6e333c2b9bb6e23a4de079565a387d309ae /lib/sqlalchemy/testing/assertions.py
parent3d55263c92ee29a0257d823124c353a35246cf31 (diff)
downloadsqlalchemy-4550983e0ce2f35b3585e53894c941c23693e71d.tar.gz
Performance fixes for new result set
A few small mistakes led to huge callcounts. Additionally, the warn-on-get behavior which is attempting to warn for deprecated access in SQLAlchemy 2.0 is very expensive; it's not clear if its feasible to have this warning or to somehow alter how it works. Fixes: #5340 Change-Id: I73bdd2d7b6f1b25cc0222accabd585cf761a5af4
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r--lib/sqlalchemy/testing/assertions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py
index 87e5ba0d2..ba4a2de72 100644
--- a/lib/sqlalchemy/testing/assertions.py
+++ b/lib/sqlalchemy/testing/assertions.py
@@ -168,7 +168,9 @@ def _expect_warnings(
else:
real_warn(msg, *arg, **kw)
- with mock.patch("warnings.warn", our_warn):
+ with mock.patch("warnings.warn", our_warn), mock.patch(
+ "sqlalchemy.util.SQLALCHEMY_WARN_20", True
+ ), mock.patch("sqlalchemy.engine.row.LegacyRow._default_key_style", 2):
yield
if assert_ and (not py2konly or not compat.py3k):