summaryrefslogtreecommitdiff
path: root/tests/testutils.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-03-26 10:59:27 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-03-26 12:59:14 +0000
commit66c543b16c5d26f1a48fa71664b6fa32712b082d (patch)
tree455d5adba3697abbc588bf81aead4466eafc4381 /tests/testutils.py
parentf34e44b3f426bb62103578704d66eac699ee752e (diff)
downloadpsycopg2-66c543b16c5d26f1a48fa71664b6fa32712b082d.tar.gz
Parse bytea output format ourselves instead of using the libpq
PG 9.0 uses the hex format by default, and clients < 9.0 can't parse that format, requiring client update and great care in what is linked at runtime, and generally giving headache to users and transitively us.
Diffstat (limited to 'tests/testutils.py')
-rw-r--r--tests/testutils.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index 2459894..26551d4 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -140,24 +140,6 @@ def skip_if_no_namedtuple(f):
return skip_if_no_namedtuple_
-def skip_if_broken_hex_binary(f):
- """Decorator to detect libpq < 9.0 unable to parse bytea in hex format"""
- def cope_with_hex_binary_(self):
- from psycopg2 import InterfaceError
- try:
- return f(self)
- except InterfaceError, e:
- if '9.0' in str(e) and self.conn.server_version >= 90000:
- return self.skipTest(
- # FIXME: we are only assuming the libpq is older here,
- # but we don't have a reliable way to detect the libpq
- # version, not pre-9 at least.
- "bytea broken with server >= 9.0, libpq < 9")
- else:
- raise
-
- return cope_with_hex_binary_
-
def skip_if_no_iobase(f):
"""Skip a test if io.TextIOBase is not available."""
def skip_if_no_iobase_(self):