]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Move test
authorCommanderKeynes <andrewjackson947@gmail.coma>
Mon, 6 Jan 2025 03:25:54 +0000 (21:25 -0600)
committerCommanderKeynes <andrewjackson947@gmail.coma>
Mon, 6 Jan 2025 03:25:54 +0000 (21:25 -0600)
test/dialect/postgresql/test_async_pg_py3k.py
test/dialect/postgresql/test_dialect.py

index 0307e68fca87c63dafe808d66ee0265c7290e6c8..dad31508cc721411e6893682e5a63c33a949df01 100644 (file)
@@ -332,10 +332,3 @@ class AsyncPgTest(fixtures.TestBase):
         async with engine.begin() as conn:
             await conn.execute(select(1))
             assert len(cache) > 0
-
-    @async_test
-    async def test_name_connection_func(self, metadata, async_testing_engine):
-
-        engine = async_testing_engine()
-        async with engine.begin() as conn:
-            await conn.execute(text(""))
index 892e2abc9be02a450c954ae5bca7700389b73996..c16bcf2c7372ee3525cc6f326a42f73f7a0c3ecc 100644 (file)
@@ -788,6 +788,37 @@ class MultiHostConnectTest(fixtures.TestBase):
         ):
             dialect.create_connect_args(u)
 
+class NullQueryTest(fixtures.TestBase):
+    __backend__ = True
+
+    @testing.only_on(["+psycopg", "+psycopg2", "+asyncpg"])
+    @testing.combinations(
+        ("postgresql+D://U:PS@/DB?host=H:P&host=H:P&host=H:P"),
+        argnames="pattern",
+    )
+    def test_multiple_host_real_connect(
+        self, testing_engine, pattern
+    ):
+        tdb_url = testing.db.url
+
+        host = tdb_url.host
+        if host == "127.0.0.1":
+            host = "localhost"
+        port = str(tdb_url.port) if tdb_url.port else "5432"
+
+        url_string = (
+            pattern.replace("DB", tdb_url.database)
+            .replace("postgresql+D", tdb_url.drivername)
+            .replace("U", tdb_url.username)
+            .replace("PS", tdb_url.password)
+            .replace("H", host)
+            .replace("P", port)
+        )
+
+        e = testing_engine(url_string)
+        with e.connect() as conn:
+            conn.exec_driver_sql("")
+
 
 class BackendDialectTest(fixtures.TestBase):
     __backend__ = True