From: Brett Cannon Date: Fri, 7 Sep 2007 03:17:50 +0000 (+0000) Subject: Make uuid1 and uuid4 tests conditional on whether ctypes can be imported; X-Git-Tag: v2.6a1~1334 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68a6da99e6dc127d817143f74e98d665117f99c2;p=python Make uuid1 and uuid4 tests conditional on whether ctypes can be imported; implementation of either function depends on ctypes but uuid as a whole does not. --- diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index 90671be05d..ab926ae183 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -367,6 +367,12 @@ class TestUUID(TestCase): self.assertEqual(node1, node2) def test_uuid1(self): + # uuid1 requires ctypes. + try: + import ctypes + except ImportError: + return + equal = self.assertEqual # Make sure uuid1() generates UUIDs that are actually version 1. @@ -420,6 +426,12 @@ class TestUUID(TestCase): equal(str(u), v) def test_uuid4(self): + # uuid4 requires ctypes. + try: + import ctypes + except ImportError: + return + equal = self.assertEqual # Make sure uuid4() generates UUIDs that are actually version 4.