diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-29 17:29:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 17:29:29 (GMT) |
commit | 0681b4c82c98fc69491711a21583cbfe49af729c (patch) | |
tree | 6fef526ce441ddfb6247c2c5bc42860a8465cdd7 /Lib/test/test_asyncio | |
parent | f7ce40213d923d72963bd66488b27a81238e84c5 (diff) | |
download | cpython-0681b4c82c98fc69491711a21583cbfe49af729c.zip cpython-0681b4c82c98fc69491711a21583cbfe49af729c.tar.gz cpython-0681b4c82c98fc69491711a21583cbfe49af729c.tar.bz2 |
[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 fa35b9e89b2e207fc8bae9eb0284260d0d922e7a)
Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_sendfile.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 0198da2..d33ff19 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): |