fix flake8 complaints

This commit is contained in:
Friedrich Lindenberg 2017-12-05 17:21:08 +01:00
parent db9729a228
commit 2cf9da068a
3 changed files with 6 additions and 7 deletions

View File

@ -130,7 +130,7 @@ class Database(object):
if error_type is None:
try:
self.commit()
except:
except Exception:
with safe_reraise():
self.rollback()
else:

View File

@ -460,7 +460,7 @@ class Table(object):
offset=_offset)
if len(order_by):
query = query.order_by(*order_by)
conn = self.db.executable
if _streamed:
conn = self.db.engine.connect()

View File

@ -300,8 +300,8 @@ class TableTestCase(unittest.TestCase):
def test_count(self):
assert len(self.tbl) == 6, len(self.tbl)
l = self.tbl.count(place=TEST_CITY_1)
assert l == 3, l
length = self.tbl.count(place=TEST_CITY_1)
assert length == 3, length
def test_find(self):
ds = list(self.tbl.find(place=TEST_CITY_1))
@ -430,9 +430,8 @@ class TableTestCase(unittest.TestCase):
assert keys[1] == 'place'
def test_empty_query(self):
m = self.tbl.find(place='not in data')
l = list(m) # exhaust iterator
assert len(l) == 0
empty = list(self.tbl.find(place='not in data'))
assert len(empty) == 0, empty
class Constructor(dict):