Skip to content

Commit a9d5966

Browse files
[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 fa35b9e) Co-authored-by: zcxsythenew <[email protected]>
1 parent 78150c6 commit a9d5966

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)