From 4b97a16f1cd3272c7a675486cea1792a9f1a969c Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 1 Feb 2023 02:04:04 +0100 Subject: [PATCH] test: test hstore registration using different encodings Reproduce the "emerging" bug reported in #503. --- tests/types/test_hstore.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" -- 2.47.2