Skip to content

Commit

Permalink
Update pytest-pyodide to 0.52 (pyodide#3859)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane authored Jun 2, 2023
1 parent 2062852 commit d823e91
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyodide-build/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pyodide.cli =
[options.extras_require]
test =
pytest
pytest-pyodide==0.23.2
pytest-pyodide==0.52.0
deploy =
boto3
moto
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
pytest-cov
pytest-httpserver
pytest-benchmark
pytest-pyodide==0.23.2
pytest-pyodide==0.52.0
10 changes: 8 additions & 2 deletions src/tests/test_package_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d823e91

Please sign in to comment.