summaryrefslogtreecommitdiff
path: root/tests/test_green.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_green.py')
-rwxr-xr-xtests/test_green.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_green.py b/tests/test_green.py
index 506b38f..0424a2c 100755
--- a/tests/test_green.py
+++ b/tests/test_green.py
@@ -29,6 +29,7 @@ import psycopg2.extras
from testutils import ConnectingTestCase
+
class ConnectionStub(object):
"""A `connection` wrapper allowing analysis of the `poll()` calls."""
def __init__(self, conn):
@@ -43,6 +44,7 @@ class ConnectionStub(object):
self.polls.append(rv)
return rv
+
class GreenTestCase(ConnectingTestCase):
def setUp(self):
self._cb = psycopg2.extensions.get_wait_callback()
@@ -89,7 +91,7 @@ class GreenTestCase(ConnectingTestCase):
curs.fetchone()
# now try to do something that will fail in the callback
- psycopg2.extensions.set_wait_callback(lambda conn: 1//0)
+ psycopg2.extensions.set_wait_callback(lambda conn: 1 // 0)
self.assertRaises(ZeroDivisionError, curs.execute, "select 2")
self.assert_(conn.closed)