[3.12] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111461)

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

Windows is different.
(cherry picked from commit fa35b9e89b)

Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-10-29 18:29:29 +01:00 committed by GitHub
parent f7ce40213d
commit 0681b4c82c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -470,6 +470,9 @@ class SendfileMixin(SendfileBase):
self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA), self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA),
srv_proto.nbytes) srv_proto.nbytes)
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.assertTrue(1024 <= self.file.tell() < len(self.DATA),
self.file.tell()) self.file.tell())
self.assertTrue(cli_proto.transport.is_closing()) self.assertTrue(cli_proto.transport.is_closing())