]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(crdb): skip tests where CRDB seems to misread binary numeric values
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 6 Jun 2022 21:55:40 +0000 (23:55 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
Reported upstream at https://github.com/cockroachdb/cockroach/issues/82492

tests/fix_crdb.py
tests/types/test_numeric.py

index b827fb66eb5ad1c4081df8190fb34dba7215d39a..5cf9d087a09d63ead2cc23695eec7f792a6bf6f8 100644 (file)
@@ -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,
index 183f4c4a02aea90f766a283677848426e5472583..b2222eabf39435a0f82be37bc82da1d294560ad5 100644 (file)
@@ -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