From: Daniele Varrazzo Date: Tue, 12 Jul 2022 11:38:11 +0000 (+0100) Subject: test(crdb): test severity_nonlocalized on CRDB versions supporting it X-Git-Tag: 3.1~49^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85acb5329be5cc44d50edc81c0928238b351b272;p=thirdparty%2Fpsycopg.git test(crdb): test severity_nonlocalized on CRDB versions supporting it --- diff --git a/tests/fix_crdb.py b/tests/fix_crdb.py index 27144774d..b90c64229 100644 --- a/tests/fix_crdb.py +++ b/tests/fix_crdb.py @@ -126,4 +126,5 @@ _crdb_reason_version = { "backend pid": "skip < 22", "cancel": "skip < 22", "server-side cursor": "skip < 22.1.3", + "severity_nonlocalized": "skip < 22.1.3", } diff --git a/tests/test_errors.py b/tests/test_errors.py index 3aced3cd0..23ad314fd 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -12,6 +12,7 @@ from .utils import eur, gc_collect from .fix_crdb import is_crdb +@pytest.mark.crdb_skip("severity_nonlocalized") def test_error_diag(conn): cur = conn.cursor() with pytest.raises(e.DatabaseError) as excinfo: @@ -20,8 +21,7 @@ def test_error_diag(conn): exc = excinfo.value diag = exc.diag assert diag.sqlstate == "42P01" - # https://github.com/cockroachdb/cockroach/issues/81794 - assert (diag.severity_nonlocalized or diag.severity) == "ERROR" + assert diag.severity_nonlocalized == "ERROR" def test_diag_all_attrs(pgconn):