Skip to content

Commit 4b4422a

Browse files
committed
Fixes unit test for newer versions of psycopg2.
Version 2.8.0 of Psycopg2 introduces more granular errors for queries. This commit fixes a unit test to assert on the specific error instead of the now-updated base class. The previous matching class was ProgrammingError. For the specific test, it is now UndefinedColumn, which is a subclass of ProgrammingError.
1 parent 3cec38d commit 4b4422a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/ext/psycopg2/test_psycopg2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_execute_bad_query():
144144
assert sql['database_version']
145145

146146
exception = subsegment.cause['exceptions'][0]
147-
assert exception.type == 'ProgrammingError'
147+
assert exception.type == 'UndefinedColumn'
148148

149149

150150
def test_register_extensions():

0 commit comments

Comments
 (0)