File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ def test_readinto(self):
160160 # the payload below are smaller than PIPE_BUF, hence the writes will be
161161 # atomic
162162 datas = [b"hello" , b"world" , b"spam" ]
163- bufs = [bytearray (5 ), bytearray (5 ), bytearray (4 )]
164163
165164 code = '\n ' .join ((
166165 'import os, sys, time' ,
@@ -178,9 +177,10 @@ def test_readinto(self):
178177 proc = self .subprocess (code , str (wr ), pass_fds = [wr ])
179178 with kill_on_error (proc ):
180179 os .close (wr )
181- for data , buffer in zip (datas , bufs ):
182- os .readinto (rd , buffer )
183- self .assertEqual (data , buffer )
180+ for data in datas :
181+ buffer = bytearray (len (data ))
182+ self .assertEqual (os .readinto (rd , buffer ), len (data ))
183+ self .assertEqual (buffer , data )
184184 self .assertEqual (proc .wait (), 0 )
185185
186186 def test_write (self ):
You can’t perform that action at this time.
0 commit comments