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

Method resize_stress

Lib/test/test_bytes.py:2929–2935  ·  view source on GitHub ↗
(ba)

Source from the content-addressed store, hash-verified

2927 @threading_helper.requires_working_threading()
2928 def test_free_threading_bytearray_resize(self):
2929 def resize_stress(ba):
2930 for _ in range(1000):
2931 try:
2932 ba.resize(1000)
2933 ba.resize(1)
2934 except (BufferError, ValueError):
2935 pass
2936
2937 ba = bytearray(100)
2938 threads = [threading.Thread(target=resize_stress, args=(ba,)) for _ in range(4)]

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected