mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-105539: Fix ResourceWarning from unclosed SQLite connections in test_sqlite3 (#108360)
Follow up to 1a1bfc2891.
Explicitly manage connections in:
- test_audit.test_sqlite3
- test_sqlite3.test_audit
- test_sqlite3.test_backup
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
31b61d19ab
commit
29bc6165ab
3 changed files with 16 additions and 13 deletions
|
|
@ -137,7 +137,7 @@ def progress(status, remaining, total):
|
|||
raise SystemError('nearly out of space')
|
||||
|
||||
with self.assertRaises(SystemError) as err:
|
||||
with sqlite.connect(':memory:') as bck:
|
||||
with memory_database() as bck:
|
||||
self.cx.backup(bck, progress=progress)
|
||||
self.assertEqual(str(err.exception), 'nearly out of space')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue