From: Daniele Varrazzo Date: Mon, 6 Jun 2022 21:55:40 +0000 (+0200) Subject: test(crdb): skip tests where CRDB seems to misread binary numeric values X-Git-Tag: 3.1~49^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e99d6e363d3915da9395897d185e6abde40c9a91;p=thirdparty%2Fpsycopg.git test(crdb): skip tests where CRDB seems to misread binary numeric values Reported upstream at https://github.com/cockroachdb/cockroach/issues/82492 --- diff --git a/tests/fix_crdb.py b/tests/fix_crdb.py index b827fb66e..5cf9d087a 100644 --- a/tests/fix_crdb.py +++ b/tests/fix_crdb.py @@ -86,6 +86,7 @@ _crdb_reasons = { "2-phase commit": 22329, "backend pid": 35897, "batch statements": 44803, + "binary decimal": 82492, "cancel": 41335, "cast adds tz": 51692, "cidr": 18846, diff --git a/tests/types/test_numeric.py b/tests/types/test_numeric.py index 183f4c4a0..b2222eabf 100644 --- a/tests/types/test_numeric.py +++ b/tests/types/test_numeric.py @@ -399,7 +399,15 @@ def test_dump_numeric_binary(conn, expr): @pytest.mark.slow -@pytest.mark.parametrize("fmt_in", PyFormat) +@pytest.mark.parametrize( + "fmt_in", + [ + f + if f != PyFormat.BINARY + else pytest.param(f, marks=pytest.mark.crdb("skip", reason="binary decimal")) + for f in PyFormat + ], +) def test_dump_numeric_exhaustive(conn, fmt_in): cur = conn.cursor() @@ -425,7 +433,7 @@ def test_dump_numeric_exhaustive(conn, fmt_in): expr = f(i) val = Decimal(expr) cur.execute(f"select %{fmt_in.value}::text, %s::decimal::text", [val, expr]) - want, got = cur.fetchone() + got, want = cur.fetchone() assert got == want