Commit 35ab0f9e authored by Brett Cannon's avatar Brett Cannon

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.
parent d0bffff8
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment