diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-24 11:04:18 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-24 11:04:18 +0000 |
commit | 5a025825cc4843e7f57f97db50c471a881380f9f (patch) | |
tree | 2bffc37fe683f53aa969b3a940808b653dfdb5f1 | |
parent | bb44bcd5b5516225b0ba53476652a2892b2c580b (diff) | |
download | psycopg2-5a025825cc4843e7f57f97db50c471a881380f9f.tar.gz |
Skip test if uuid not available on Python.
-rw-r--r-- | tests/types_extras.py | 7 |
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_ |