MCPcopy Index your code
hub / github.com/python/cpython / test_parts_multithreaded

Method test_parts_multithreaded

Lib/test/test_pathlib/test_join.py:164–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

BarrierMethod · 0.80
PClass · 0.70

Tested by

no test coverage detected