| 162 | |
| 163 | @threading_helper.requires_working_threading() |
| 164 | def test_parts_multithreaded(self): |
| 165 | P = self.cls |
| 166 | |
| 167 | NUM_THREADS = 10 |
| 168 | NUM_ITERS = 10 |
| 169 | |
| 170 | for _ in range(NUM_ITERS): |
| 171 | b = threading.Barrier(NUM_THREADS) |
| 172 | path = P('a') / 'b' / 'c' / 'd' / 'e' |
| 173 | expected = ('a', 'b', 'c', 'd', 'e') |
| 174 | |
| 175 | def check_parts(): |
| 176 | b.wait() |
| 177 | self.assertEqual(path.parts, expected) |
| 178 | |
| 179 | threads = [threading.Thread(target=check_parts) for _ in range(NUM_THREADS)] |
| 180 | with threading_helper.start_threads(threads): |
| 181 | pass |
| 182 | |
| 183 | def test_parent(self): |
| 184 | # Relative |