[3.11] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111462)
https://github.com/python/cpython/commit/a9d5966bce9bb347002d4da7672bf49fe42... commit: a9d5966bce9bb347002d4da7672bf49fe4274ea4 branch: 3.11 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: willingc <carolcode@willingconsulting.com> date: 2023-10-30T18:14:30-07:00 summary: [3.11] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111462) gh-111347: Remove wrong assertion in test_sendfile (GH-111377) Windows is different. (cherry picked from commit fa35b9e89b2e207fc8bae9eb0284260d0d922e7a) Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com> files: M Lib/test/test_asyncio/test_sendfile.py diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 0198da21d7702..d33ff197bbfa1 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -470,8 +470,11 @@ def test_sendfile_close_peer_in_the_middle_of_receiving(self): 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):
participants (1)
-
willingc