fix flake8 complaints
This commit is contained in:
parent
db9729a228
commit
2cf9da068a
@ -130,7 +130,7 @@ class Database(object):
|
|||||||
if error_type is None:
|
if error_type is None:
|
||||||
try:
|
try:
|
||||||
self.commit()
|
self.commit()
|
||||||
except:
|
except Exception:
|
||||||
with safe_reraise():
|
with safe_reraise():
|
||||||
self.rollback()
|
self.rollback()
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -300,8 +300,8 @@ class TableTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def test_count(self):
|
def test_count(self):
|
||||||
assert len(self.tbl) == 6, len(self.tbl)
|
assert len(self.tbl) == 6, len(self.tbl)
|
||||||
l = self.tbl.count(place=TEST_CITY_1)
|
length = self.tbl.count(place=TEST_CITY_1)
|
||||||
assert l == 3, l
|
assert length == 3, length
|
||||||
|
|
||||||
def test_find(self):
|
def test_find(self):
|
||||||
ds = list(self.tbl.find(place=TEST_CITY_1))
|
ds = list(self.tbl.find(place=TEST_CITY_1))
|
||||||
@ -430,9 +430,8 @@ class TableTestCase(unittest.TestCase):
|
|||||||
assert keys[1] == 'place'
|
assert keys[1] == 'place'
|
||||||
|
|
||||||
def test_empty_query(self):
|
def test_empty_query(self):
|
||||||
m = self.tbl.find(place='not in data')
|
empty = list(self.tbl.find(place='not in data'))
|
||||||
l = list(m) # exhaust iterator
|
assert len(empty) == 0, empty
|
||||||
assert len(l) == 0
|
|
||||||
|
|
||||||
|
|
||||||
class Constructor(dict):
|
class Constructor(dict):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user