summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/suite
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-02-06 15:17:20 +0100
committerMike Bayer <mike_mp@zzzcomputing.com>2021-03-24 11:45:39 -0400
commit502be87a0b5c7bfa28db62b4af867457cd29a5fa (patch)
treecd54dda88546e34cca1a019fd40e89d91ee703ca /lib/sqlalchemy/testing/suite
parent021f2ab7f5e03be3b6a5ad7f2c0e22bd93b83b18 (diff)
downloadsqlalchemy-502be87a0b5c7bfa28db62b4af867457cd29a5fa.tar.gz
Add support for aiosqlite
Added support for the aiosqlite database driver for use with the SQLAlchemy asyncio extension. Fixes: #5920 Change-Id: Id11a320516a44e886a6f518d2866a0f992413e55
Diffstat (limited to 'lib/sqlalchemy/testing/suite')
-rw-r--r--lib/sqlalchemy/testing/suite/test_dialect.py14
-rw-r--r--lib/sqlalchemy/testing/suite/test_results.py13
2 files changed, 19 insertions, 8 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py
index a236b1076..c2c17d0dd 100644
--- a/lib/sqlalchemy/testing/suite/test_dialect.py
+++ b/lib/sqlalchemy/testing/suite/test_dialect.py
@@ -180,8 +180,8 @@ class AutocommitIsolationTest(fixtures.TablesTest):
with conn.begin():
conn.execute(self.tables.some_table.delete())
- def test_autocommit_on(self):
- conn = config.db.connect()
+ def test_autocommit_on(self, connection_no_trans):
+ conn = connection_no_trans
c2 = conn.execution_options(isolation_level="AUTOCOMMIT")
self._test_conn_autocommits(c2, True)
@@ -189,12 +189,14 @@ class AutocommitIsolationTest(fixtures.TablesTest):
self._test_conn_autocommits(conn, False)
- def test_autocommit_off(self):
- conn = config.db.connect()
+ def test_autocommit_off(self, connection_no_trans):
+ conn = connection_no_trans
self._test_conn_autocommits(conn, False)
- def test_turn_autocommit_off_via_default_iso_level(self):
- conn = config.db.connect()
+ def test_turn_autocommit_off_via_default_iso_level(
+ self, connection_no_trans
+ ):
+ conn = connection_no_trans
conn = conn.execution_options(isolation_level="AUTOCOMMIT")
self._test_conn_autocommits(conn, True)
diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py
index e8dd6cf2c..6c2880ad4 100644
--- a/lib/sqlalchemy/testing/suite/test_results.py
+++ b/lib/sqlalchemy/testing/suite/test_results.py
@@ -227,6 +227,8 @@ class ServerSideCursorsTest(
__backend__ = True
def _is_server_side(self, cursor):
+ # TODO: this is a huge issue as it prevents these tests from being
+ # usable by third party dialects.
if self.engine.dialect.driver == "psycopg2":
return bool(cursor.name)
elif self.engine.dialect.driver == "pymysql":
@@ -239,7 +241,7 @@ class ServerSideCursorsTest(
return isinstance(cursor, sscursor)
elif self.engine.dialect.driver == "mariadbconnector":
return not cursor.buffered
- elif self.engine.dialect.driver == "asyncpg":
+ elif self.engine.dialect.driver in ("asyncpg", "aiosqlite"):
return cursor.server_side
else:
return False
@@ -279,7 +281,14 @@ class ServerSideCursorsTest(
False,
),
("for_update_expr", True, select(1).with_for_update(), True),
- ("for_update_string", True, "SELECT 1 FOR UPDATE", True),
+ # TODO: need a real requirement for this, or dont use this test
+ (
+ "for_update_string",
+ True,
+ "SELECT 1 FOR UPDATE",
+ True,
+ testing.skip_if("sqlite"),
+ ),
("text_no_ss", False, text("select 42"), False),
(
"text_ss_option",