From 3a74a0d93e63032ebee02992977498c717a077ff Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Wed, 2 Nov 2022 08:32:55 +0100 Subject: [PATCH] Use literal_column() instead of literal() in test This is an attempt to workaround an issue with asyncpg, where passing a literal range as argument causes the following error: : invalid input for query argument $1: 'empty' (list, tuple or Range object expected (got type )) --- test/dialect/postgresql/test_dialect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 608843b596..7bb3740f51 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -1232,8 +1232,8 @@ class TestRange(fixtures.TestBase): ) def test_contains_value(self, connection, rrepr, v): q = select( - literal(rrepr, INT4RANGE), - literal(rrepr, INT4RANGE).contains(v), + literal_column(f"'{rrepr}'::int4range", INT4RANGE), + literal_column(f"'{rrepr}'::int4range", INT4RANGE).contains(v), ) r, expected = connection.execute(q).first() eq_(r.contains(v), expected) -- 2.47.3