Skip to content

Commit

Permalink
skip test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanking13 committed Aug 10, 2024
1 parent 9da9df8 commit d04a9b8
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions packages/Cartopy/test_cartopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import pytest
from pytest_pyodide import run_in_pyodide

from conftest import package_is_built

DECORATORS = [
pytest.mark.xfail_browsers(node="No supported matplotlib backends on node"),
pytest.mark.skip_refcount_check,
Expand All @@ -25,22 +27,29 @@ def test_imports(selenium):


@matplotlib_test_decorator
@run_in_pyodide(packages=["Cartopy", "matplotlib", "pyodide-http"])
def test_matplotlib(selenium):
import io

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import pyodide_http
if not package_is_built("pyodide-http"):
pytest.skip("pyodide-http is not built")

@run_in_pyodide(packages=["Cartopy", "matplotlib", "pyodide-http"])
def run(selenium):
import io

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import pyodide_http

pyodide_http.patch_all()
pyodide_http.patch_all()

ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()

fd = io.BytesIO()
plt.savefig(fd, format="svg")
fd = io.BytesIO()
plt.savefig(fd, format="svg")

content = fd.getvalue().decode("utf8")
assert len(content) > 100000
assert content.startswith("<?xml")
content = fd.getvalue().decode("utf8")
assert len(content) > 100000
assert content.startswith("<?xml")

run(selenium)

0 comments on commit d04a9b8

Please sign in to comment.