From: Daniele Varrazzo Date: Wed, 1 Feb 2023 01:04:04 +0000 (+0100) Subject: test: test hstore registration using different encodings X-Git-Tag: pool-3.1.7~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b97a16f1cd3272c7a675486cea1792a9f1a969c;p=thirdparty%2Fpsycopg.git test: test hstore registration using different encodings Reproduce the "emerging" bug reported in #503. --- diff --git a/tests/types/test_hstore.py b/tests/types/test_hstore.py index 5142d58ce..1648e2637 100644 --- a/tests/types/test_hstore.py +++ b/tests/types/test_hstore.py @@ -46,7 +46,9 @@ def test_parse_bad(s): loader.load(s.encode()) -def test_register_conn(hstore, conn): +@pytest.mark.parametrize("encoding", ["utf8", "latin1", "sql_ascii"]) +def test_register_conn(hstore, conn, encoding): + conn.execute("select set_config('client_encoding', %s, false)", [encoding]) info = TypeInfo.fetch(conn, "hstore") register_hstore(info, conn) assert conn.adapters.types[info.oid].name == "hstore"