summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-09 17:15:55 (GMT)
committerGitHub <noreply@github.com>2023-06-09 17:15:55 (GMT)
commitbc365da711f8c8039f10d75572af674cf82d5b20 (patch)
treea7528c77602a889a9ea66b5ada6104f51b4f4dea /Lib/test
parent16b1cdc87c08c01294b66257a26574725b005c50 (diff)
downloadcpython-bc365da711f8c8039f10d75572af674cf82d5b20.zip
cpython-bc365da711f8c8039f10d75572af674cf82d5b20.tar.gz
cpython-bc365da711f8c8039f10d75572af674cf82d5b20.tar.bz2
[3.12] gh-105557: Remove duplicate sqlite3 test method (GH-105558) (#105561)
test_func_return_too_large_int() was defined twice. Keep only the redefined method, as that also checks the tracebacks. (cherry picked from commit b8fa7bda4f286503447dc12327b789bbfc836458) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_sqlite3/test_userfunctions.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/test/test_sqlite3/test_userfunctions.py b/Lib/test/test_sqlite3/test_userfunctions.py
index 632d657..03d2753 100644
--- a/Lib/test/test_sqlite3/test_userfunctions.py
+++ b/Lib/test/test_sqlite3/test_userfunctions.py
@@ -195,7 +195,6 @@ class FunctionTests(unittest.TestCase):
self.con.create_function("returnblob", 0, func_returnblob)
self.con.create_function("returnlonglong", 0, func_returnlonglong)
self.con.create_function("returnnan", 0, lambda: float("nan"))
- self.con.create_function("returntoolargeint", 0, lambda: 1 << 65)
self.con.create_function("return_noncont_blob", 0,
lambda: memoryview(b"blob")[::2])
self.con.create_function("raiseexception", 0, func_raiseexception)
@@ -294,11 +293,6 @@ class FunctionTests(unittest.TestCase):
cur.execute("select returnnan()")
self.assertIsNone(cur.fetchone()[0])
- def test_func_return_too_large_int(self):
- cur = self.con.cursor()
- self.assertRaisesRegex(sqlite.DataError, "string or blob too big",
- self.con.execute, "select returntoolargeint()")
-
@with_tracebacks(ZeroDivisionError, name="func_raiseexception")
def test_func_exception(self):
cur = self.con.cursor()
@@ -444,9 +438,10 @@ class FunctionTests(unittest.TestCase):
@with_tracebacks(OverflowError)
def test_func_return_too_large_int(self):
cur = self.con.cursor()
+ msg = "string or blob too big"
for value in 2**63, -2**63-1, 2**64:
self.con.create_function("largeint", 0, lambda value=value: value)
- with self.assertRaises(sqlite.DataError):
+ with self.assertRaisesRegex(sqlite.DataError, msg):
cur.execute("select largeint()")
@with_tracebacks(UnicodeEncodeError, "surrogates not allowed", "chr")