mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604)
This commit is contained in:
parent
751c9ed801
commit
88567a9970
4 changed files with 13 additions and 6 deletions
|
@ -502,11 +502,13 @@ class AggregateTests(unittest.TestCase):
|
|||
with self.assertRaises(sqlite.OperationalError):
|
||||
self.con.create_function("bla", -100, AggrSum)
|
||||
|
||||
@with_tracebacks(AttributeError, name="AggrNoStep")
|
||||
def test_aggr_no_step(self):
|
||||
cur = self.con.cursor()
|
||||
with self.assertRaises(AttributeError) as cm:
|
||||
with self.assertRaises(sqlite.OperationalError) as cm:
|
||||
cur.execute("select nostep(t) from test")
|
||||
self.assertEqual(str(cm.exception), "'AggrNoStep' object has no attribute 'step'")
|
||||
self.assertEqual(str(cm.exception),
|
||||
"user-defined aggregate's 'step' method not defined")
|
||||
|
||||
def test_aggr_no_finalize(self):
|
||||
cur = self.con.cursor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue