diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-01 15:44:44 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-07 14:30:35 -0500 |
| commit | d050193daaa8d91371c759296f3304b8641c1976 (patch) | |
| tree | f3f880ccd528d1dc6c1dafa1a19b71c7c953fdce /lib/sqlalchemy/testing/fixtures.py | |
| parent | 248d232459e38561999c4172acaaddd651c1a933 (diff) | |
| download | sqlalchemy-d050193daaa8d91371c759296f3304b8641c1976.tar.gz | |
fully implement future engine and remove legacy
The major action here is to lift and move future.Connection
and future.Engine fully into sqlalchemy.engine.base. This
removes lots of engine concepts, including:
* autocommit
* Connection running without a transaction, autobegin
is now present in all cases
* most "autorollback" is obsolete
* Core-level subtransactions (i.e. MarkerTransaction)
* "branched" connections, copies of connections
* execution_options() returns self, not a new connection
* old argument formats, distill_params(), simplifies calling
scheme between engine methods
* before/after_execute() events (oriented towards compiled constructs)
don't emit for exec_driver_sql(). before/after_cursor_execute()
is still included for this
* old helper methods superseded by context managers, connection.transaction(),
engine.transaction() engine.run_callable()
* ancient engine-level reflection methods has_table(), table_names()
* sqlalchemy.testing.engines.proxying_engine
References: #7257
Change-Id: Ib20ed816642d873b84221378a9ec34480e01e82c
Diffstat (limited to 'lib/sqlalchemy/testing/fixtures.py')
| -rw-r--r-- | lib/sqlalchemy/testing/fixtures.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py index f04056c5e..1899e5b7c 100644 --- a/lib/sqlalchemy/testing/fixtures.py +++ b/lib/sqlalchemy/testing/fixtures.py @@ -5,7 +5,6 @@ # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php -import contextlib import re import sys @@ -93,9 +92,7 @@ class TestBase(object): @config.fixture() def future_engine(self): - eng = getattr(self, "bind", None) or config.db - with _push_future_engine(eng): - yield + yield @config.fixture() def testing_engine(self): @@ -114,7 +111,6 @@ class TestBase(object): return engines.testing_engine( url=url, options=options, - future=future, asyncio=asyncio, transfer_staticpool=transfer_staticpool, ) @@ -303,26 +299,8 @@ class TestBase(object): _connection_fixture_connection = None -@contextlib.contextmanager -def _push_future_engine(engine): - - from ..future.engine import Engine - from sqlalchemy import testing - - facade = Engine._future_facade(engine) - config._current.push_engine(facade, testing) - - yield facade - - config._current.pop(testing) - - class FutureEngineMixin(object): - @config.fixture(autouse=True, scope="class") - def _push_future_engine(self): - eng = getattr(self, "bind", None) or config.db - with _push_future_engine(eng): - yield + """alembic's suite still using this""" class TablesTest(TestBase): |
