[pypy-commit] pypy default: fix test_sqlite3 for older sqlite versions

bdkearns noreply at buildbot.pypy.org
Sat Mar 8 21:38:12 CET 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r69806:d6ca8475ef71
Date: 2014-03-08 12:37 -0800
http://bitbucket.org/pypy/pypy/changeset/d6ca8475ef71/

Log:	fix test_sqlite3 for older sqlite versions

diff --git a/pypy/module/test_lib_pypy/test_sqlite3.py b/pypy/module/test_lib_pypy/test_sqlite3.py
--- a/pypy/module/test_lib_pypy/test_sqlite3.py
+++ b/pypy/module/test_lib_pypy/test_sqlite3.py
@@ -236,8 +236,14 @@
         return 42
     con.set_authorizer(authorizer_cb)
     with pytest.raises(_sqlite3.OperationalError) as e:
-        con.execute('select 42')
-    assert str(e.value) == 'authorizer malfunction'
+        con.execute('select 123')
+    major, minor, micro = _sqlite3.sqlite_version.split('.')[:3]
+    if (int(major), int(minor), int(micro)) >= (3, 6, 14):
+        assert str(e.value) == 'authorizer malfunction'
+    else:
+        assert str(e.value) == \
+            ("illegal return value (1) from the authorization function - "
+             "should be SQLITE_OK, SQLITE_IGNORE, or SQLITE_DENY")
 
 
 def test_issue1573(con):


More information about the pypy-commit mailing list