Skip to content

Commit 57d4fba

Browse files
committed
fix tests on Windows
1 parent 6b08305 commit 57d4fba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Lib/test/test_ssl.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
HAS_KEYLOG = hasattr(ssl.SSLContext, 'keylog_filename')
6161
requires_keylog = unittest.skipUnless(
6262
HAS_KEYLOG, 'test requires OpenSSL 1.1.1 with keylog callback')
63+
CAN_SET_KEYLOG = HAS_KEYLOG and os.name != "nt"
64+
requires_keylog_setter = unittest.skipUnless(
65+
CAN_SET_KEYLOG,
66+
"cannot set 'keylog_filename' on Windows"
67+
)
68+
6369

6470
PROTOCOL_TO_TLS_VERSION = {}
6571
for proto, ver in (
@@ -1777,7 +1783,7 @@ def msg_callback(*args, _=ctx, **kwargs): ...
17771783
ctx._msg_callback = msg_callback
17781784

17791785
@support.cpython_only
1780-
@requires_keylog
1786+
@requires_keylog_setter
17811787
def test_refcycle_keylog_filename(self):
17821788
# See https://github.com/python/cpython/issues/142516.
17831789
self.addCleanup(os_helper.unlink, os_helper.TESTFN)

0 commit comments

Comments
 (0)