bpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604)

This commit is contained in:
Erlend Egeberg Aasland 2022-03-03 14:54:36 +01:00 committed by GitHub
parent 751c9ed801
commit 88567a9970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View file

@ -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()