From: Denis Laxalde Date: Thu, 23 Mar 2023 08:52:39 +0000 (+0100) Subject: tests: skip test_sql::test_invalid_name if not a super-user X-Git-Tag: pool-3.1.7~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a914adc839b1ed53d02f5b25c223f5cf768b16d3;p=thirdparty%2Fpsycopg.git tests: skip test_sql::test_invalid_name if not a super-user Creating a base type, as done in that test, requires being a superuser. --- diff --git a/tests/test_sql.py b/tests/test_sql.py index 42b6c63ce..b1ec8d85d 100644 --- a/tests/test_sql.py +++ b/tests/test_sql.py @@ -366,6 +366,8 @@ class TestLiteral: @pytest.mark.crdb_skip("composite") # create type, actually @pytest.mark.parametrize("name", ["a-b", f"{eur}", "order", "foo bar"]) def test_invalid_name(self, conn, name): + if conn.info.parameter_status("is_superuser") != "on": + pytest.skip("not a superuser") conn.execute( f""" set client_encoding to utf8;