gh-111347: Remove wrong assertion in test_sendfile (#111377)

Windows is different.
This commit is contained in:
zcxsythenew 2023-10-29 23:22:15 +08:00 committed by GitHub
parent 14ab5e51c1
commit fa35b9e89b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,8 +470,11 @@ class SendfileMixin(SendfileBase):
self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA),
srv_proto.nbytes)
self.assertTrue(1024 <= self.file.tell() < len(self.DATA),
self.file.tell())
if not (sys.platform == 'win32'
and isinstance(self.loop, asyncio.ProactorEventLoop)):
# On Windows, Proactor uses transmitFile, which does not update tell()
self.assertTrue(1024 <= self.file.tell() < len(self.DATA),
self.file.tell())
self.assertTrue(cli_proto.transport.is_closing())
def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(self):