From: Daniele Varrazzo Date: Mon, 28 Jun 2021 14:07:14 +0000 (+0100) Subject: Don't assume that the user "postgres" always exists in tests X-Git-Tag: 3.0.dev0~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e21dcbbf0acac181e8fff1845ee5c1ac592e7ffd;p=thirdparty%2Fpsycopg.git Don't assume that the user "postgres" always exists in tests --- diff --git a/tests/types/test_array.py b/tests/types/test_array.py index 90cf1bd1e..b04b75237 100644 --- a/tests/types/test_array.py +++ b/tests/types/test_array.py @@ -128,10 +128,10 @@ def test_array_register(conn): def test_array_of_unknown_builtin(conn): + user = conn.execute("select user").fetchone()[0] # we cannot load this type, but we understand it is an array - val = "postgres=arwdDxt/postgres" - cur = conn.cursor() - cur.execute(f"select '{val}'::aclitem, array['{val}']::aclitem[]") + val = f"{user}=arwdDxt/{user}" + cur = conn.execute(f"select '{val}'::aclitem, array['{val}']::aclitem[]") res = cur.fetchone() assert cur.description[0].type_code == builtins["aclitem"].oid assert res[0] == val