Skip to content

Commit

Permalink
Disable live server tests on Windows for now
Browse files Browse the repository at this point in the history
  • Loading branch information
abkfenris committed May 17, 2024
1 parent 21ed418 commit 2f9d5b7
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
"""Test OpenDAP clients against Xpublish OpenDAP plugin."""
"""Test OpenDAP clients against Xpublish OpenDAP plugin.
Live tests are currently failing on Windows, see:
- https://github.com/Unidata/netcdf-c/issues/2459
- https://github.com/Unidata/netcdf4-python/issues/1246
- https://github.com/pydata/xarray/issues/7773
"""

import sys

import netCDF4
import pytest
import xarray as xr


@pytest.mark.skipif(
sys.platform == "win32",
reason="NetCDF4 is failing on Windows Github Actions workers",
)
def test_netcdf4(xpublish_server):
"""Test opening OpenDAP air dataset directly with NetCDF4 library."""
url = f"{xpublish_server}/datasets/air/opendap"
netCDF4.Dataset(url)


@pytest.mark.skipif(
sys.platform == "win32",
reason="NetCDF4 is failing on Windows Github Actions workers",
)
def test_default_xarray_engine(xpublish_server, dataset):
"""Test opening OpenDAP air dataset with default Xarray engine."""
url = f"{xpublish_server}/datasets/air/opendap"
ds = xr.open_dataset(url)
assert ds == dataset


@pytest.mark.skipif(
sys.platform == "win32",
reason="NetCDF4 is failing on Windows Github Actions workers",
)
@pytest.mark.parametrize(
"engine",
[
Expand All @@ -33,6 +53,10 @@ def test_xarray_engines(xpublish_server, engine, dataset):
assert ds == dataset


@pytest.mark.skipif(
sys.platform == "win32",
reason="NetCDF4 is failing on Windows Github Actions workers",
)
def test_attrs_quotes(xpublish_server):
"""Test that we are formatting OpenDAP attributes that contain '"' properly."""
url = f"{xpublish_server}/datasets/attrs_quote/opendap"
Expand All @@ -41,6 +65,10 @@ def test_attrs_quotes(xpublish_server):
assert ds.attrs["quotes"] == 'This attribute uses "quotes"'


@pytest.mark.skipif(
sys.platform == "win32",
reason="NetCDF4 is failing on Windows Github Actions workers",
)
def test_attrs_types(xpublish_server):
"""Test that we are formatting OpenDAP attributes that contain '"' properly."""
url = f"{xpublish_server}/datasets/attrs_cast/opendap"
Expand Down

0 comments on commit 2f9d5b7

Please sign in to comment.