From 4b4422a3ad9bb9a28399b34851dd574f6155bb66 Mon Sep 17 00:00:00 2001 From: Jeffery Saeteurn Date: Tue, 11 Jun 2019 15:13:00 -0700 Subject: [PATCH] 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. --- tests/ext/psycopg2/test_psycopg2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ext/psycopg2/test_psycopg2.py b/tests/ext/psycopg2/test_psycopg2.py index c491d706..e9eb207d 100644 --- a/tests/ext/psycopg2/test_psycopg2.py +++ b/tests/ext/psycopg2/test_psycopg2.py @@ -144,7 +144,7 @@ def test_execute_bad_query(): assert sql['database_version'] exception = subsegment.cause['exceptions'][0] - assert exception.type == 'ProgrammingError' + assert exception.type == 'UndefinedColumn' def test_register_extensions():