diff options
author | CaselIT <cfederico87@gmail.com> | 2020-10-19 23:23:08 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-11 23:41:43 -0500 |
commit | 365283aac593698fa483b54554f9443db3fe4933 (patch) | |
tree | 08cfa15232ef2e63b444d506f5750a704f97901e /tests/test_mysql.py | |
parent | ebc1ea35b127bd56c48dcae43d226471fd6bf6c0 (diff) | |
download | alembic-365283aac593698fa483b54554f9443db3fe4933.tar.gz |
Accommodate SQLAlchemy 1.4/2.0
To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer
assumes that the SQLAlchemy Connection will autocommit an individual
operation. This essentially means that for databases that use
non-transactional DDL (pysqlite current driver behavior, MySQL), there is
still a BEGIN/COMMIT block that will surround each individual migration.
Databases that support transactional DDL should continue to have the
same flow, either per migration or per-entire run, depending on the
value of the :paramref:`.Environment.configure.transaction_per_migration`
flag.
Compatibility is established such that the entire library should
not generate any SQLAlchemy 2.0 deprecation warnings and
SQLALCHEMY_WARN_20 is part of conftest.py. (one warning remains
for the moment that needs to be resolved on the SQLAlchemy side)
The test suite requires SQLAlchemy 1.4.0b2 for testing 1.4;
1.4.0b1 won't work.
Test suite / setup also being modernized, as we are at
SQLAlchemy 1.3 we can now remove the majority of the testing
suite plugin.
Change-Id: If55b1ea3c12ead66405ab3fadc76d15d89dabb90
Diffstat (limited to 'tests/test_mysql.py')
-rw-r--r-- | tests/test_mysql.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_mysql.py b/tests/test_mysql.py index caef197..ba43e3a 100644 --- a/tests/test_mysql.py +++ b/tests/test_mysql.py @@ -594,10 +594,11 @@ class MySQLDefaultCompareTest(TestBase): clear_staging_env() def setUp(self): - self.metadata = MetaData(self.bind) + self.metadata = MetaData() def tearDown(self): - self.metadata.drop_all() + with config.db.begin() as conn: + self.metadata.drop_all(conn) def _compare_default_roundtrip(self, type_, txt, alternate=None): if alternate: |