summaryrefslogtreecommitdiff
path: root/tests/test_quote.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-24 00:18:22 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-24 01:03:57 +0100
commita478ba9a4785eac4839f0c4f65e90f6557d42c65 (patch)
tree01504972bfd2aec0dd2a4ee75928b571f9da3dc8 /tests/test_quote.py
parentb3cd125d2757872e9337d8df3d8e286345a67450 (diff)
downloadpsycopg2-a478ba9a4785eac4839f0c4f65e90f6557d42c65.tar.gz
Fixed tests failing on Python 2.6
Diffstat (limited to 'tests/test_quote.py')
-rwxr-xr-xtests/test_quote.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_quote.py b/tests/test_quote.py
index f74fd85..72c9c1e 100755
--- a/tests/test_quote.py
+++ b/tests/test_quote.py
@@ -65,11 +65,13 @@ class QuotingTestCase(ConnectingTestCase):
curs = self.conn.cursor()
data = 'abcd\x01\x00cdefg'
- with self.assertRaises(ValueError) as e:
+ try:
curs.execute("SELECT %s", (data,))
-
- self.assertEquals(str(e.exception),
- 'A string literal cannot contain NUL (0x00) characters.')
+ except ValueError as e:
+ self.assertEquals(str(e),
+ 'A string literal cannot contain NUL (0x00) characters.')
+ else:
+ self.fail("ValueError not raised")
def test_binary(self):
data = b"""some data with \000\013 binary