@@ -33,14 +33,14 @@ class TestExecute(WithSchema):
3333
3434 def test_execute_executes (self ):
3535 self .db .execute ("CREATE TABLE foo (bar text)" )
36- actual = list ( self .db .fetchall ("SELECT tablename FROM pg_tables "
37- "WHERE schemaname='public'" ) )
36+ actual = self .db .fetchall ("SELECT tablename FROM pg_tables "
37+ "WHERE schemaname='public'" )
3838 assert actual == [{"tablename" : "foo" }]
3939
4040 def test_execute_inserts (self ):
4141 self .db .execute ("CREATE TABLE foo (bar text)" )
4242 self .db .execute ("INSERT INTO foo VALUES ('baz')" )
43- actual = len (list ( self .db .fetchone ("SELECT * FROM foo ORDER BY bar" ) ))
43+ actual = len (self .db .fetchone ("SELECT * FROM foo ORDER BY bar" ))
4444 assert actual == 1
4545
4646
@@ -55,7 +55,7 @@ def test_fetchone_returns_None_if_theres_none(self):
5555 assert actual is None
5656
5757 def test_fetchall_fetches_all (self ):
58- actual = list ( self .db .fetchall ("SELECT * FROM foo ORDER BY bar" ) )
58+ actual = self .db .fetchall ("SELECT * FROM foo ORDER BY bar" )
5959 assert actual == [{"bar" : "baz" }, {"bar" : "buz" }]
6060
6161
@@ -81,14 +81,14 @@ def test_transaction_is_isolated(self):
8181 with self .db .get_transaction () as txn :
8282 txn .execute ("INSERT INTO foo VALUES ('blam')" )
8383 txn .execute ("SELECT * FROM foo ORDER BY bar" )
84- actual = list ( self .db .fetchall ("SELECT * FROM foo ORDER BY bar" ) )
84+ actual = self .db .fetchall ("SELECT * FROM foo ORDER BY bar" )
8585 assert actual == [{"bar" : "baz" }, {"bar" : "buz" }]
8686
8787 def test_transaction_commits_on_success (self ):
8888 with self .db .get_transaction () as txn :
8989 txn .execute ("INSERT INTO foo VALUES ('blam')" )
9090 txn .execute ("SELECT * FROM foo ORDER BY bar" )
91- actual = list ( self .db .fetchall ("SELECT * FROM foo ORDER BY bar" ) )
91+ actual = self .db .fetchall ("SELECT * FROM foo ORDER BY bar" )
9292 assert actual == [{"bar" : "baz" }, {"bar" : "blam" }, {"bar" : "buz" }]
9393
9494 def test_transaction_rolls_back_on_failure (self ):
@@ -100,7 +100,7 @@ class Heck(Exception): pass
100100 raise Heck
101101 except Heck :
102102 pass
103- actual = list ( self .db .fetchall ("SELECT * FROM foo ORDER BY bar" ) )
103+ actual = self .db .fetchall ("SELECT * FROM foo ORDER BY bar" )
104104 assert actual == [{"bar" : "baz" }, {"bar" : "buz" }]
105105
106106
0 commit comments