New submission from Michael Felt <aixto...@felt.demon.nl>:

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.

----------
messages: 326769
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: fix test_sqlite for AIX

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34860>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to