10000 [3.12] gh-111347: Remove wrong assertion in test_sendfile (GH-111377)… · python/cpython@0681b4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0681b4c

Browse files
[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 fa35b9e) Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
1 parent f7ce402 commit 0681b4c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_asyncio/test_sendfile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,11 @@ def test_sendfile_close_peer_in_the_middle_of_receiving(self):
470470

471471
self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA),
472472
srv_proto.nbytes)
473-
self.assertTrue(1024 <= self.file.tell() < len(self.DATA),
474-
self.file.tell())
473+
if not (sys.platform == 'win32'
474+
and isinstance(self.loop, asyncio.ProactorEventLoop)):
475+
# On Windows, Proactor uses transmitFile, which does not update tell()
476+
self.assertTrue(1024 <= self.file.tell() < len(self.DATA),
477+
self.file.tell())
475478
self.assertTrue(cli_proto.transport.is_closing())
476479

477480
def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(self):

0 commit comments

Comments
 (0)
0