bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591)

This commit is contained in:
Erlend Egeberg Aasland 2021-11-29 16:22:32 +01:00 committed by GitHub
parent 6ac3c8a314
commit c4a69a4ad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 34 deletions

View file

@ -197,7 +197,7 @@ class ProgressTests(unittest.TestCase):
con.execute("select 1 union select 2 union select 3").fetchall()
self.assertEqual(action, 0, "progress handler was not cleared")
@with_tracebacks(['bad_progress', 'ZeroDivisionError'])
@with_tracebacks(ZeroDivisionError, name="bad_progress")
def test_error_in_progress_handler(self):
con = sqlite.connect(":memory:")
def bad_progress():
@ -208,7 +208,7 @@ class ProgressTests(unittest.TestCase):
create table foo(a, b)
""")
@with_tracebacks(['__bool__', 'ZeroDivisionError'])
@with_tracebacks(ZeroDivisionError, name="bad_progress")
def test_error_in_progress_handler_result(self):
con = sqlite.connect(":memory:")
class BadBool: