Skip test if uuid not available on Python.

This commit is contained in:
Daniele Varrazzo 2010-11-24 11:04:18 +00:00
parent bb44bcd5b5
commit 5a025825cc

View File

@ -29,6 +29,11 @@ import tests
def skip_if_no_uuid(f): def skip_if_no_uuid(f):
def skip_if_no_uuid_(self): def skip_if_no_uuid_(self):
try:
import uuid
except ImportError:
return self.skipTest("uuid not available in this Python version")
try: try:
cur = self.conn.cursor() cur = self.conn.cursor()
cur.execute("select typname from pg_type where typname = 'uuid'") cur.execute("select typname from pg_type where typname = 'uuid'")
@ -39,7 +44,7 @@ def skip_if_no_uuid(f):
if has: if has:
return f(self) return f(self)
else: else:
return self.skipTest("uuid type not available") return self.skipTest("uuid type not available on the server")
return skip_if_no_uuid_ return skip_if_no_uuid_