@@ -42,6 +42,8 @@ def test_diag_all_attrs(pgconn):
42
42
res = pgconn .make_empty_result (pq .ExecStatus .NONFATAL_ERROR )
43
43
diag = e .Diagnostic (res )
44
44
for d in pq .DiagnosticField :
45
+ if d == pq .DiagnosticField .SEVERITY_NONLOCALIZED :
46
+ continue
45
47
val = getattr (diag , d .name .lower ())
46
48
assert val is None or isinstance (val , str )
47
49
@@ -62,9 +64,11 @@ def check_val(self, v):
62
64
monkeypatch .setattr (e .Diagnostic , "_error_message" , check_val )
63
65
64
66
for to_check in pq .DiagnosticField :
67
+ if to_check == pq .DiagnosticField .SEVERITY_NONLOCALIZED :
68
+ continue
65
69
getattr (diag , to_check .name .lower ())
66
70
67
- assert len (checked ) == len (pq .DiagnosticField )
71
+ assert len (checked ) == len (pq .DiagnosticField )- 1
68
72
69
73
70
74
def test_diag_attr_values (conn ):
@@ -175,6 +179,8 @@ def test_diag_pickle(conn):
175
179
176
180
assert isinstance (diag2 , type (diag1 ))
177
181
for f in pq .DiagnosticField :
182
+ if f == pq .DiagnosticField .SEVERITY_NONLOCALIZED :
183
+ continue
178
184
assert getattr (diag1 , f .name .lower ()) == getattr (diag2 , f .name .lower ())
179
185
180
186
assert diag2 .sqlstate == "42P01"
0 commit comments