mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 03:52:51 +01:00
fix some tests under PyPy
In PyPy's pure-Python implementation of the sqlite3 module, sqlite3.Row has no __len__ method. This works around calling len(row).
This commit is contained in:
parent
f06c7dfbef
commit
c499be05ea
1 changed files with 4 additions and 4 deletions
|
|
@ -654,7 +654,7 @@ class MigrationTest(unittest.TestCase):
|
|||
c = new_lib._connection().cursor()
|
||||
c.execute("select * from items")
|
||||
row = c.fetchone()
|
||||
self.assertEqual(len(row), len(self.old_fields))
|
||||
self.assertEqual(len(row.keys()), len(self.old_fields))
|
||||
|
||||
def test_open_with_new_field_adds_column(self):
|
||||
new_lib = beets.library.Library(self.libfile,
|
||||
|
|
@ -662,7 +662,7 @@ class MigrationTest(unittest.TestCase):
|
|||
c = new_lib._connection().cursor()
|
||||
c.execute("select * from items")
|
||||
row = c.fetchone()
|
||||
self.assertEqual(len(row), len(self.new_fields))
|
||||
self.assertEqual(len(row.keys()), len(self.new_fields))
|
||||
|
||||
def test_open_with_fewer_fields_leaves_untouched(self):
|
||||
new_lib = beets.library.Library(self.libfile,
|
||||
|
|
@ -670,7 +670,7 @@ class MigrationTest(unittest.TestCase):
|
|||
c = new_lib._connection().cursor()
|
||||
c.execute("select * from items")
|
||||
row = c.fetchone()
|
||||
self.assertEqual(len(row), len(self.old_fields))
|
||||
self.assertEqual(len(row.keys()), len(self.old_fields))
|
||||
|
||||
def test_open_with_multiple_new_fields(self):
|
||||
new_lib = beets.library.Library(self.libfile,
|
||||
|
|
@ -678,7 +678,7 @@ class MigrationTest(unittest.TestCase):
|
|||
c = new_lib._connection().cursor()
|
||||
c.execute("select * from items")
|
||||
row = c.fetchone()
|
||||
self.assertEqual(len(row), len(self.newer_fields))
|
||||
self.assertEqual(len(row.keys()), len(self.newer_fields))
|
||||
|
||||
def test_open_old_db_adds_album_table(self):
|
||||
conn = sqlite3.connect(self.libfile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue