Issue 34860: fix test_sqlite for AIX (original) (raw)

On AIX test_sqlite fails with:

====================================================================== FAIL: test_database_source_name (sqlite3.test.backup.BackupTests)

Traceback (most recent call last): File "/home/aixtools/python/git/aix-pr/Lib/sqlite3/test/backup.py", line 146, in test_database_source_name ['SQL logic error', 'SQL logic error or missing database'] AssertionError: 'unrecognized error code: 1' not found in ['SQL logic error', 'SQL logic error or missing database']

Likely this is because the sqlite3 that is installed either has a bug, is too old, or was overly optimized and the expected error message is not being returned.

A simple addition as: def test_database_source_name(self): with sqlite.connect(':memory:') as bck: self.cx.backup(bck, name='main') with sqlite.connect(':memory:') as bck: self.cx.backup(bck, name='temp') with self.assertRaises(sqlite.OperationalError) as cm: with sqlite.connect(':memory:') as bck: self.cx.backup(bck, name='non-existing') self.assertIn( str(cm.exception), ['SQL logic error', 'SQL logic error or missing database', 'unrecognized error code: 1'] )

allows to test to pass.

Again, this is not a problem with either python or AIX - only yhe implementation of sqlite3 installed.

My hope is that the PR with the modification above (add 'unrecognized error code: 1') will be accepted.

Thx for your consideration.