summaryrefslogtreecommitdiff
path: root/Lib/sqlite3/test/userfunctions.py
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2006-06-14 22:28:37 +0000
committerGerhard Häring <gh@ghaering.de>2006-06-14 22:28:37 +0000
commitb2e881640377945716a5f4b147f8438f9e4738de (patch)
treee4a52a0b9356e3c53248723e7f65565de694d6ce /Lib/sqlite3/test/userfunctions.py
parent69f6168b766d3fb8fbd0dec8cbeaf97ce564e2c4 (diff)
downloadcpython-git-b2e881640377945716a5f4b147f8438f9e4738de.tar.gz
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions. - Added version checks in test suite so that we don't execute tests that we know will fail with older (buggy) SQLite versions. Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6 (latest one now). The sqlite3 module can be built against all these SQLite versions and the sqlite3 module does its best to not trigger bugs in SQLite, but using SQLite 3.3.3 or later is recommended.
Diffstat (limited to 'Lib/sqlite3/test/userfunctions.py')
-rw-r--r--Lib/sqlite3/test/userfunctions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py
index 215178c023..587d39c876 100644
--- a/Lib/sqlite3/test/userfunctions.py
+++ b/Lib/sqlite3/test/userfunctions.py
@@ -200,6 +200,8 @@ class FunctionTests(unittest.TestCase):
self.failUnlessEqual(val, buffer("blob"))
def CheckFuncException(self):
+ if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions
+ return
cur = self.con.cursor()
try:
cur.execute("select raiseexception()")
@@ -283,6 +285,8 @@ class AggregateTests(unittest.TestCase):
self.failUnlessEqual(e.args[0], "AggrNoStep instance has no attribute 'step'")
def CheckAggrNoFinalize(self):
+ if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions
+ return
cur = self.con.cursor()
try:
cur.execute("select nofinalize(t) from test")
@@ -292,6 +296,8 @@ class AggregateTests(unittest.TestCase):
self.failUnlessEqual(e.args[0], "user-defined aggregate's 'finalize' method raised error")
def CheckAggrExceptionInInit(self):
+ if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions
+ return
cur = self.con.cursor()
try:
cur.execute("select excInit(t) from test")
@@ -301,6 +307,8 @@ class AggregateTests(unittest.TestCase):
self.failUnlessEqual(e.args[0], "user-defined aggregate's '__init__' method raised error")
def CheckAggrExceptionInStep(self):
+ if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions
+ return
cur = self.con.cursor()
try:
cur.execute("select excStep(t) from test")
@@ -310,6 +318,8 @@ class AggregateTests(unittest.TestCase):
self.failUnlessEqual(e.args[0], "user-defined aggregate's 'step' method raised error")
def CheckAggrExceptionInFinalize(self):
+ if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions
+ return
cur = self.con.cursor()
try:
cur.execute("select excFinalize(t) from test")