summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-24 11:04:18 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-24 11:04:18 +0000
commit5a025825cc4843e7f57f97db50c471a881380f9f (patch)
tree2bffc37fe683f53aa969b3a940808b653dfdb5f1
parentbb44bcd5b5516225b0ba53476652a2892b2c580b (diff)
downloadpsycopg2-5a025825cc4843e7f57f97db50c471a881380f9f.tar.gz
Skip test if uuid not available on Python.
-rw-r--r--tests/types_extras.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/types_extras.py b/tests/types_extras.py
index f733950..61d2857 100644
--- a/tests/types_extras.py
+++ b/tests/types_extras.py
@@ -30,6 +30,11 @@ import tests
def skip_if_no_uuid(f):
def skip_if_no_uuid_(self):
try:
+ import uuid
+ except ImportError:
+ return self.skipTest("uuid not available in this Python version")
+
+ try:
cur = self.conn.cursor()
cur.execute("select typname from pg_type where typname = 'uuid'")
has = cur.fetchone()
@@ -39,7 +44,7 @@ def skip_if_no_uuid(f):
if has:
return f(self)
else:
- return self.skipTest("uuid type not available")
+ return self.skipTest("uuid type not available on the server")
return skip_if_no_uuid_