From: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:22:15 +0000 (+0800) Subject: gh-111347: Remove wrong assertion in test_sendfile (#111377) X-Git-Tag: v3.13.0a2~289 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa35b9e89b2e207fc8bae9eb0284260d0d922e7a;p=thirdparty%2FPython%2Fcpython.git gh-111347: Remove wrong assertion in test_sendfile (#111377) Windows is different. --- diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 0198da21d770..d33ff197bbfa 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -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):