Skip to content

Commit

Permalink
iostream_test: Don't require server-side log on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Nov 14, 2023
1 parent 06e1a65 commit 2da0a99
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tornado/test/iostream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,12 @@ async def test_match(self):
@gen_test
async def test_no_match(self):
stream = SSLIOStream(socket.socket(), ssl_options=self.client_ssl_ctx)
with ExpectLog(gen_log, ".*alert bad certificate", level=logging.WARNING):
with ExpectLog(
gen_log,
".*alert bad certificate",
level=logging.WARNING,
required=platform.system() != "Windows",
):
with self.assertRaises(ssl.SSLCertVerificationError):
with ExpectLog(
gen_log,
Expand All @@ -1210,7 +1215,9 @@ async def test_no_match(self):
)
# The server logs a warning while cleaning up the failed connection.
# Unfortunately there's no good hook to wait for this logging.
await asyncio.sleep(0.1)
# It doesn't seem to happen on windows; I'm not sure why.
if platform.system() != "Windows":
await asyncio.sleep(0.1)

@gen_test
async def test_check_disabled(self):
Expand Down

0 comments on commit 2da0a99

Please sign in to comment.