From: CommanderKeynes Date: Mon, 6 Jan 2025 03:25:54 +0000 (-0600) Subject: Move test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb1ada8a739a6bed6822d3e679876f5f4fb3928;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Move test --- diff --git a/test/dialect/postgresql/test_async_pg_py3k.py b/test/dialect/postgresql/test_async_pg_py3k.py index 0307e68fca..dad31508cc 100644 --- a/test/dialect/postgresql/test_async_pg_py3k.py +++ b/test/dialect/postgresql/test_async_pg_py3k.py @@ -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("")) diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 892e2abc9b..c16bcf2c73 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -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