summaryrefslogtreecommitdiff
path: root/tests/test_async.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-10-11 00:10:53 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-10-11 00:11:55 +0100
commit91d2158de7954daccb0a22885021c8416d1d5c6c (patch)
tree0c6d537c377ee095d7d4d451477931d7a310dd11 /tests/test_async.py
parent4458c9b4c94e524237fb39c7821b248fc2a85e35 (diff)
downloadpsycopg2-91d2158de7954daccb0a22885021c8416d1d5c6c.tar.gz
Python source cleanup using flake8
Diffstat (limited to 'tests/test_async.py')
-rwxr-xr-xtests/test_async.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_async.py b/tests/test_async.py
index e0bca7d..6f8fed5 100755
--- a/tests/test_async.py
+++ b/tests/test_async.py
@@ -33,6 +33,7 @@ import StringIO
from testutils import ConnectingTestCase
+
class PollableStub(object):
"""A 'pollable' wrapper allowing analysis of the `poll()` calls."""
def __init__(self, pollable):
@@ -68,6 +69,7 @@ class AsyncTests(ConnectingTestCase):
def test_connection_setup(self):
cur = self.conn.cursor()
sync_cur = self.sync_conn.cursor()
+ del cur, sync_cur
self.assert_(self.conn.async)
self.assert_(not self.sync_conn.async)
@@ -77,7 +79,7 @@ class AsyncTests(ConnectingTestCase):
# check other properties to be found on the connection
self.assert_(self.conn.server_version)
- self.assert_(self.conn.protocol_version in (2,3))
+ self.assert_(self.conn.protocol_version in (2, 3))
self.assert_(self.conn.encoding in psycopg2.extensions.encodings)
def test_async_named_cursor(self):
@@ -108,6 +110,7 @@ class AsyncTests(ConnectingTestCase):
def test_async_after_async(self):
cur = self.conn.cursor()
cur2 = self.conn.cursor()
+ del cur2
cur.execute("insert into table1 values (1)")
@@ -422,14 +425,14 @@ class AsyncTests(ConnectingTestCase):
def test_async_cursor_gone(self):
import gc
cur = self.conn.cursor()
- cur.execute("select 42;");
+ cur.execute("select 42;")
del cur
gc.collect()
self.assertRaises(psycopg2.InterfaceError, self.wait, self.conn)
# The connection is still usable
cur = self.conn.cursor()
- cur.execute("select 42;");
+ cur.execute("select 42;")
self.wait(self.conn)
self.assertEqual(cur.fetchone(), (42,))
@@ -449,4 +452,3 @@ def test_suite():
if __name__ == "__main__":
unittest.main()
-