mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)
This commit is contained in:
parent
b8509ffa82
commit
c1ae741997
3 changed files with 46 additions and 57 deletions
|
@ -149,10 +149,7 @@ class BackupTests(unittest.TestCase):
|
|||
with self.assertRaises(sqlite.OperationalError) as cm:
|
||||
with sqlite.connect(':memory:') as bck:
|
||||
self.cx.backup(bck, name='non-existing')
|
||||
self.assertIn(
|
||||
str(cm.exception),
|
||||
['SQL logic error', 'SQL logic error or missing database']
|
||||
)
|
||||
self.assertIn("unknown database", str(cm.exception))
|
||||
|
||||
self.cx.execute("ATTACH DATABASE ':memory:' AS attached_db")
|
||||
self.cx.execute('CREATE TABLE attached_db.foo (key INTEGER)')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue