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

Method test_move

Lib/test/test_free_threading/test_mmap.py:117–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 self.assertEqual(counter[letter], per_thread_write_loop * 3)
116
117 def test_move(self):
118 ascii_uppercase = string.ascii_uppercase.encode()
119 num_letters = len(ascii_uppercase)
120
121 def move(mm_obj):
122 for i in range(num_letters):
123 # Move 1 byte from the first half to the second half
124 mm_obj.move(0 + i, num_letters + i, 1)
125
126 with mmap.mmap(ANONYMOUS_MEM, 2 * num_letters) as mm_obj:
127 mm_obj.write(ascii_uppercase)
128 run_concurrently(
129 worker_func=move,
130 args=(mm_obj,),
131 nthreads=NTHREADS,
132 )
133
134 def test_seek_and_tell(self):
135 seek_per_thread = 10

Callers

nothing calls this directly

Calls 3

run_concurrentlyFunction · 0.90
encodeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected