diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-10-31 20:48:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-10-31 20:48:33 +0000 |
commit | f5956e13d5bc456802a09a0ed89b3c596161e390 (patch) | |
tree | d02b0e34e549c9b00aaad6fef25edf7f000380e6 /lib/sqlalchemy/testing | |
parent | a1adb21cbe83ecce467194ab0e3277db581dfa4d (diff) | |
parent | aa026c302c6b188a7e28508f9ecb603809b9e03f (diff) | |
download | sqlalchemy-f5956e13d5bc456802a09a0ed89b3c596161e390.tar.gz |
Merge "2.0 removals: LegacyRow, connectionless execution, close_with_result" into main
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/profiling.py | 7 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 4 |
3 files changed, 4 insertions, 13 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 6bf14aecd..c30fdf823 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -204,11 +204,7 @@ def _expect_warnings( with mock.patch("warnings.warn", our_warn), mock.patch( "sqlalchemy.util.SQLALCHEMY_WARN_20", True - ), mock.patch( - "sqlalchemy.util.deprecations.SQLALCHEMY_WARN_20", True - ), mock.patch( - "sqlalchemy.engine.row.LegacyRow._default_key_style", 2 - ): + ), mock.patch("sqlalchemy.util.deprecations.SQLALCHEMY_WARN_20", True): try: yield finally: diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py index de4847f2f..dd5040205 100644 --- a/lib/sqlalchemy/testing/profiling.py +++ b/lib/sqlalchemy/testing/profiling.py @@ -243,17 +243,12 @@ def function_call_count(variance=0.05, times=1, warmup=0): from sqlalchemy.util import decorator from sqlalchemy.util import deprecations - from sqlalchemy.engine import row from sqlalchemy.testing import mock @decorator def wrap(fn, *args, **kw): - with mock.patch.object( - deprecations, "SQLALCHEMY_WARN_20", False - ), mock.patch.object( - row.LegacyRow, "_default_key_style", row.KEY_OBJECTS_NO_WARN - ): + with mock.patch.object(deprecations, "SQLALCHEMY_WARN_20", False): for warm in range(warmup): fn(*args, **kw) diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index a3475f651..63502b077 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -206,8 +206,8 @@ class FetchLimitOffsetTest(fixtures.TablesTest): eq_(connection.execute(select, params).fetchall(), result) def _assert_result_str(self, select, result, params=()): - conn = config.db.connect(close_with_result=True) - eq_(conn.exec_driver_sql(select, params).fetchall(), result) + with config.db.connect() as conn: + eq_(conn.exec_driver_sql(select, params).fetchall(), result) def test_simple_limit(self, connection): table = self.tables.some_table |