(self)
| 1120 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 1121 | @support.requires_fork() |
| 1122 | def testIssue8621(self): |
| 1123 | # On at least some versions of OSX self.uuid.uuid4 generates |
| 1124 | # the same sequence of UUIDs in the parent and any |
| 1125 | # children started using fork. |
| 1126 | fds = os.pipe() |
| 1127 | pid = os.fork() |
| 1128 | if pid == 0: |
| 1129 | os.close(fds[0]) |
| 1130 | value = self.uuid.uuid4() |
| 1131 | os.write(fds[1], value.hex.encode('latin-1')) |
| 1132 | os._exit(0) |
| 1133 | |
| 1134 | else: |
| 1135 | os.close(fds[1]) |
| 1136 | self.addCleanup(os.close, fds[0]) |
| 1137 | parent_value = self.uuid.uuid4().hex |
| 1138 | support.wait_process(pid, exitcode=0) |
| 1139 | child_value = os.read(fds[0], 100).decode('latin-1') |
| 1140 | |
| 1141 | self.assertNotEqual(parent_value, child_value) |
| 1142 | |
| 1143 | def test_uuid_weakref(self): |
| 1144 | # bpo-35701: check that weak referencing to a UUID object can be created |
nothing calls this directly
no test coverage detected