import shutil
import subprocess
import sys
+import weakref
from unittest import mock
py_uuid = support.import_fresh_module('uuid', blocked=['_uuid'])
self.assertNotEqual(parent_value, child_value)
+ def test_uuid_weakref(self):
+ # bpo-35701: check that weak referencing to a UUID object can be created
+ strong = self.uuid.uuid4()
+ weak = weakref.ref(strong)
+ self.assertIs(strong, weak())
class TestUUIDWithoutExtModule(BaseTestUUID, unittest.TestCase):
uuid = py_uuid
uuid_generate_time_safe(3).
"""
- __slots__ = ('int', 'is_safe')
+ __slots__ = ('int', 'is_safe', '__weakref__')
def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
int=None, version=None,