Skip to content

Commit e485595

Browse files
committed
Add take_bytes to test_free_threading
1 parent 20175f8 commit e485595

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_bytes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,11 @@ def zfill(b, a):
26222622
c = a.zfill(0x400000)
26232623
assert not c or c[-1] not in (0xdd, 0xcd)
26242624

2625+
def take_bytes(b, a):
2626+
b.wait()
2627+
c = b.take_bytes()
2628+
assert not c or c[0] == 48 # '0'
2629+
26252630
def check(funcs, a=None, *args):
26262631
if a is None:
26272632
a = bytearray(b'0' * 0x400000)
@@ -2682,6 +2687,7 @@ def check(funcs, a=None, *args):
26822687
check([clear] + [splitlines] * 10, bytearray(b'\n' * 0x400))
26832688
check([clear] + [startswith] * 10)
26842689
check([clear] + [strip] * 10)
2690+
check([clear] + [take_bytes] * 10)
26852691

26862692
check([clear] + [contains] * 10)
26872693
check([clear] + [subscript] * 10)

0 commit comments

Comments
 (0)