8000 gh-111347: Remove wrong assertion in test_sendfile (#111377) · python/cpython@fa35b9e · GitHub
[go: up one dir, main page]

Skip to content

Commit fa35b9e

Browse files
authored
gh-111347: Remove wrong assertion in test_sendfile (#111377)
Windows is different.
1 parent 14ab5e5 commit fa35b9e

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