2022-07-31 10:00:45 +00:00
|
|
|
from pytest_pyodide import run_in_pyodide
|
2022-03-12 06:05:36 +00:00
|
|
|
|
|
|
|
|
2022-08-21 23:52:50 +00:00
|
|
|
@run_in_pyodide(packages=["test", "ssl"], pytest_assert_rewrites=False)
|
2022-05-26 02:47:43 +00:00
|
|
|
def test_ssl(selenium):
|
2022-03-12 06:05:36 +00:00
|
|
|
import platform
|
|
|
|
import unittest
|
|
|
|
import unittest.mock
|
2024-01-30 16:19:53 +00:00
|
|
|
from test.libregrtest.main import main
|
2022-03-12 06:05:36 +00:00
|
|
|
|
|
|
|
platform.platform(aliased=True)
|
|
|
|
name = "test_ssl"
|
|
|
|
ignore_tests = [
|
|
|
|
"*test_context_custom_class*",
|
|
|
|
"*ThreadedTests*",
|
|
|
|
"*ocket*",
|
|
|
|
"test_verify_flags",
|
|
|
|
"test_subclass",
|
|
|
|
"test_lib_reason",
|
2022-08-21 23:52:50 +00:00
|
|
|
"test_unwrap",
|
2022-03-12 06:05:36 +00:00
|
|
|
]
|
2024-01-30 16:19:53 +00:00
|
|
|
match_tests = [[pat, False] for pat in ignore_tests]
|
2022-03-12 06:05:36 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
with unittest.mock.patch(
|
|
|
|
"test.support.socket_helper.bind_port",
|
|
|
|
side_effect=unittest.SkipTest("nope!"),
|
|
|
|
):
|
2024-01-30 16:19:53 +00:00
|
|
|
main([name], match_tests=match_tests, verbose=True, verbose3=True)
|
2022-03-12 06:05:36 +00:00
|
|
|
except SystemExit as e:
|
|
|
|
if e.code != 0:
|
2022-09-13 22:12:40 +00:00
|
|
|
raise RuntimeError(f"Failed with code: {e.code}") from None
|