Update pytest-pyodide to 0.52 (#3859)

This commit is contained in:
Hood Chatham 2023-06-02 10:01:39 -06:00 committed by GitHub
parent 2062852fd2
commit d823e91e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View File

@ -69,7 +69,7 @@ repos:
hooks:
- id: mypy
files: ^(packages/.*/src|src|pyodide-build/pyodide_build)
exclude: (setup.py|src/tests|conftest.py|packages/.*/test)
exclude: (setup.py|.*test.*)
args: []
additional_dependencies: &mypy-deps
- packaging

View File

@ -60,7 +60,7 @@ pyodide.cli =
[options.extras_require]
test =
pytest
pytest-pyodide==0.23.2
pytest-pyodide==0.52.0
deploy =
boto3
moto

View File

@ -12,4 +12,4 @@
pytest-cov
pytest-httpserver
pytest-benchmark
pytest-pyodide==0.23.2
pytest-pyodide==0.52.0

View File

@ -67,7 +67,7 @@ def test_load_relative_url(
url, port, _ = web_server_main
test_html = (ROOT_PATH / "src/templates/test.html").read_text()
test_html = test_html.replace("./pyodide.js", f"http://{url}:{port}/pyodide.js")
(tmp_path / "test.html").write_text(test_html)
(tmp_path / "test_temp.html").write_text(test_html)
pytz_wheel = get_pytz_wheel_name()
pytz1_wheel = pytz_wheel.replace("pytz", "pytz1")
shutil.copy(DIST_PATH / pytz_wheel, tmp_path / pytz1_wheel)
@ -76,12 +76,18 @@ def test_load_relative_url(
request,
runtime,
web_server,
load_pyodide=True,
load_pyodide=False,
browsers=playwright_browsers,
script_type="classic",
) as selenium, set_webdriver_script_timeout(
selenium, script_timeout=parse_driver_timeout(request.node)
):
if selenium.browser != "node":
selenium.goto(f"http://{url}:{web_server[1]}/test_temp.html")
selenium.load_pyodide()
selenium.initialize_pyodide()
selenium.save_state()
selenium.restore_state()
if selenium.browser == "node":
selenium.run_js(f"process.chdir('{tmp_path.resolve()}')")
selenium.load_package(pytz1_wheel)