pyodide/packages/ssl/test_ssl.py

33 lines
855 B
Python

from pyodide_build.testing import run_in_pyodide
@run_in_pyodide(packages=["test", "ssl"])
def test_ssl():
import platform
import unittest
import unittest.mock
from test import libregrtest
platform.platform(aliased=True)
name = "test_ssl"
ignore_tests = [
"*test_context_custom_class*",
"*ThreadedTests*",
"*ocket*",
"test_verify_flags",
"test_subclass",
"test_lib_reason",
]
try:
with unittest.mock.patch(
"test.support.socket_helper.bind_port",
side_effect=unittest.SkipTest("nope!"),
):
libregrtest.main(
[name], ignore_tests=ignore_tests, verbose=True, verbose3=True
)
except SystemExit as e:
if e.code != 0:
raise RuntimeError(f"Failed with code: {e.code}")