remove skips from test_fixtures.py
MODIFY
tests/test_fixtures.py
tests/test_fixtures.py
import fsspec
-import pytest
import xarray as xr
+from pangeo_forge_recipes.storage import _add_query_string_secrets
from pangeo_forge_recipes.utils import fix_scalar_attr_encoding
@@ -14,12 +14,11 @@ def test_fixture_local_files(daily_xarray_dataset, netcdf_local_paths):
def test_fixture_http_files(daily_xarray_dataset, netcdf_http_paths):
urls = netcdf_http_paths[0]
- if (
- "auth" in netcdf_http_paths[-1]["fsspec_open_kwargs"].keys()
- or netcdf_http_paths[-1]["query_string_secrets"].keys()
- ):
- pytest.skip("Authentication and required query strings are tested in test_storage.py")
- open_files = [fsspec.open(url).open() for url in urls]
+ open_kwargs = netcdf_http_paths[-1]["fsspec_open_kwargs"]
+ secrets = netcdf_http_paths[-1]["query_string_secrets"]
+ if secrets:
+ urls = [_add_query_string_secrets(url, secrets) for url in urls]
+ open_files = [fsspec.open(url, **open_kwargs).open() for url in urls]
ds = xr.open_mfdataset(
open_files, combine="by_coords", concat_dim="time", engine="h5netcdf"
).load()

remove skips from test_fixtures.py