mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ignore deprecation warning from apsw
This commit is contained in:
parent
f01268b2ec
commit
aed39272af
@ -651,14 +651,18 @@ class WritingTest(BaseTest):
|
|||||||
|
|
||||||
def test_dump_and_restore(self): # {{{
|
def test_dump_and_restore(self): # {{{
|
||||||
' Test roundtripping the db through SQL '
|
' Test roundtripping the db through SQL '
|
||||||
cache = self.init_cache()
|
import warnings
|
||||||
uv = int(cache.backend.user_version)
|
with warnings.catch_warnings():
|
||||||
all_ids = cache.all_book_ids()
|
# on python 3.10 apsw raises a deprecation warning which causes this test to fail on CI
|
||||||
cache.dump_and_restore()
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
self.assertEqual(cache.set_field('title', {1:'nt'}), {1}, 'database connection broken')
|
cache = self.init_cache()
|
||||||
cache = self.init_cache()
|
uv = int(cache.backend.user_version)
|
||||||
self.assertEqual(cache.all_book_ids(), all_ids, 'dump and restore broke database')
|
all_ids = cache.all_book_ids()
|
||||||
self.assertEqual(int(cache.backend.user_version), uv)
|
cache.dump_and_restore()
|
||||||
|
self.assertEqual(cache.set_field('title', {1:'nt'}), {1}, 'database connection broken')
|
||||||
|
cache = self.init_cache()
|
||||||
|
self.assertEqual(cache.all_book_ids(), all_ids, 'dump and restore broke database')
|
||||||
|
self.assertEqual(int(cache.backend.user_version), uv)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def test_set_author_data(self): # {{{
|
def test_set_author_data(self): # {{{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user