diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-19 10:59:42 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-19 12:36:57 -0500 |
commit | 31e7428b1622ce62a90d0270a2818dc785e210e9 (patch) | |
tree | 24553562f4b304d1603241ef4ba2e91ee4d32707 /lib/sqlalchemy/dialects/sqlite | |
parent | 27766512b2d037a8f0048dccc6e2f02c281fbc9a (diff) | |
download | sqlalchemy-31e7428b1622ce62a90d0270a2818dc785e210e9.tar.gz |
Repair mssql dep tests; have __only_on__ imply __backend__
CI missed a few SQL Server tests because we run mssql-backendonly
in the gerrit job. As there was a test that was "only on"
mssql but didn't have backendonly, it never got run and then
fails in master where we run mssql fully.
Any suite that has an __only_on__ is inherently specific to
a backend, so if present this should imply __backend__ so that
it definitely runs when we have that backend present.
This in turn meant we had to fix a few sqlite_file tests that
weren't cleaning up or sharing well as they suddenly became
backend tests under sqlite_file. Added a sqlite_file cleanup
to test class cleanup for now.
Change-Id: I9de1ceabd6596547a65c59059a55b7e5156103fd
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite')
-rw-r--r-- | lib/sqlalchemy/dialects/sqlite/provision.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/provision.py b/lib/sqlalchemy/dialects/sqlite/provision.py index ce20ed991..f26c21e22 100644 --- a/lib/sqlalchemy/dialects/sqlite/provision.py +++ b/lib/sqlalchemy/dialects/sqlite/provision.py @@ -7,6 +7,7 @@ from ...testing.provision import follower_url_from_main from ...testing.provision import log from ...testing.provision import post_configure_engine from ...testing.provision import run_reap_dbs +from ...testing.provision import stop_test_class from ...testing.provision import temp_table_keyword_args @@ -56,6 +57,25 @@ def _sqlite_drop_db(cfg, eng, ident): os.remove(path) +@stop_test_class.for_db("sqlite") +def stop_test_class(config, db, cls): + with db.connect() as conn: + files = [ + row.file + for row in conn.exec_driver_sql("PRAGMA database_list") + if row.file + ] + + if files: + db.dispose() + + # some sqlite file tests are not cleaning up well yet, so do this + # just to make things simple for now + for file in files: + if file: + os.remove(file) + + @temp_table_keyword_args.for_db("sqlite") def _sqlite_temp_table_keyword_args(cfg, eng): return {"prefixes": ["TEMPORARY"]} |