@@ -359,12 +359,13 @@ async def test_provider_reads_written_data() -> None:
359359 # Start the read task in the background.
360360 read_task = asyncio .create_task (drain_provider (provider , result ))
361361 await provider .write (b"foo" )
362+ await provider .write (b"bar" )
362363
363364 # Wait for the buffer to drain. At that point all the data should
364365 # be read, but the read task won't actually be complete yet
365366 # because it's still waiting on future data.
366367 await provider .flush ()
367- assert result == [b"foo" ]
368+ assert result == [b"foo" , b"bar" ]
368369 assert not read_task .done ()
369370
370371 # Now actually close the provider, which will let the read task
@@ -373,7 +374,7 @@ async def test_provider_reads_written_data() -> None:
373374 await read_task
374375
375376 # The result should not have changed
376- assert result == [b"foo" ]
377+ assert result == [b"foo" , b"bar" ]
377378
378379
379380async def test_close_stops_writes () -> None :
@@ -393,7 +394,7 @@ async def test_close_without_flush_deletes_buffered_data() -> None:
393394 # We weren't able to read data, which is what we want. But here we dig into
394395 # the internals to be sure that the buffer is clear and no data is haning
395396 # around.
396- assert provider ._data == [] # type: ignore
397+ assert len ( provider ._data ) == 0 # type: ignore
397398
398399
399400async def test_only_max_chunks_buffered () -> None :
0 commit comments