[issue2551201] Postgres tests fail on debian oldstable

Ralf Schlatterbeck <[email protected]> Tue, 03 May 2022 11:36:35 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Ralf Schlatterbeck:

All (most?) of the postgres indexer tests and two tests in test/test_postgresql.py fail because older psycopg2 versions don't have an 'errors' module:

test/test_indexer.py:236: 
...
>   from psycopg2.errors import InFailedSqlTransaction, SyntaxError, \
                                UndefinedObject
E                               ModuleNotFoundError: No module named 'psycopg2.errors'

postgresqlDBTest.testUpgrade_6_to_7:
>       with self.assertRaises(psycopg2.errors.UndefinedTable) as ctx:
E       AttributeError: module 'psycopg2' has no attribute 'errors'

test/test_postgresql.py:113: AttributeError

postgresqlDBTest.testUpgrade_5_to_6
>       with self.assertRaises(psycopg2.errors.UndefinedTable) as ctx:
E       AttributeError: module 'psycopg2' has no attribute 'errors'

test/test_postgresql.py:113: AttributeError

I'll look into this if we can get the same results with older postgres versions.

Note that this happens for me only with python3 (which uses psycopg2 from the distribution) not with python2 where I seem to have installed a psycopg2 module by hand via pip (and not using the one shipped by debian oldstable).

So the question is if we want to fix this or recommend to use a newer psycopg2?

----------
components: Database, Test
messages: 7488
nosy: marcus.priesch, rouilj, schlatterbeck
priority: normal
severity: normal
status: new
title: Postgres tests fail on debian oldstable
versions: devel

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551201>
_________________________________________________