(self)
| 1106 | equal(u.int & 0x3fffffffffffffff, lo) |
| 1107 | |
| 1108 | def test_uuid8_uniqueness(self): |
| 1109 | # Test that UUIDv8-generated values are unique (up to a negligible |
| 1110 | # probability of failure). There are 122 bits of entropy and assuming |
| 1111 | # that the underlying mt-19937-based random generator is sufficiently |
| 1112 | # good, it is unlikely to have a collision of two UUIDs. |
| 1113 | N = 1000 |
| 1114 | uuids = {self.uuid.uuid8() for _ in range(N)} |
| 1115 | self.assertEqual(len(uuids), N) |
| 1116 | |
| 1117 | versions = {u.version for u in uuids} |
| 1118 | self.assertSetEqual(versions, {8}) |
| 1119 | |
| 1120 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 1121 | @support.requires_fork() |
nothing calls this directly
no test coverage detected