Skip to content

Commit

Permalink
Merge pull request #356 from ioos/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
ocefpaf authored Sep 3, 2024
2 parents bba1347 + 8c2b79c commit 714be99
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
files: requirements-dev.txt

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.11.2
hooks:
- id: mypy
exclude: docs/source/conf.py
Expand Down Expand Up @@ -50,7 +50,7 @@ repos:
- id: add-trailing-comma

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def test__format_constraints_url():
assert kw_url == "&latitude>=42&longitude<=42.0"


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
def test_erddap2_10():
"""Check regression for ERDDAP 2.10."""
e = ERDDAP(server="http://erddap.ioos.us/erddap/")
Expand Down
22 changes: 11 additions & 11 deletions tests/test_multiple_server_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from erddapy.multiple_server_search import fetch_results, search_servers


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
def test_fetch_results():
"""Test searches should return results."""
url = (
Expand All @@ -21,8 +21,8 @@ def test_fetch_results():
assert data is not None


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
def test_fetch_no_results():
"""Test searches that should return no results."""
url = (
Expand All @@ -35,7 +35,7 @@ def test_fetch_no_results():
assert data is None


@pytest.mark.web()
@pytest.mark.web
@pytest.mark.skipif(
sys.platform in ["win32", "darwin"],
reason="run only on linux to avoid extra load on the server",
Expand All @@ -51,7 +51,7 @@ def test_search_awesome_erddap_servers_true():
assert not df.empty


@pytest.mark.web()
@pytest.mark.web
@pytest.mark.skipif(
sys.platform in ["win32", "darwin"],
reason="run only on linux to avoid extra load on the server",
Expand All @@ -67,8 +67,8 @@ def test_search_awesome_erddap_servers_false():
assert not df.empty


@pytest.fixture()
@pytest.mark.web()
@pytest.fixture
@pytest.mark.web
def servers_list():
"""Objects for server search."""
return {
Expand All @@ -81,7 +81,7 @@ def servers_list():
}


@pytest.mark.web()
@pytest.mark.web
@pytest.mark.skipif(
(sys.platform in ["win32", "darwin"] or sys.version_info < (3, 10)),
reason="run only on linux and latest to avoid extra load on the server",
Expand All @@ -104,8 +104,8 @@ def test_search_servers_with_a_list_parallel_true(servers_list):
assert not df.empty


@pytest.mark.vcr()
@pytest.mark.web()
@pytest.mark.vcr
@pytest.mark.web
@pytest.mark.skipif(
sys.platform in ["win32", "darwin"],
reason="run only on linux to avoid extra load on the server",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_netcdf_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from erddapy.core.url import urlopen


@pytest.mark.web()
@pytest.mark.web
# For some reason we cannot use vcr with httpx with in_memory
# (also all the to_objects that uses in_memory).
def test__nc_dataset_in_memory_https():
Expand All @@ -22,8 +22,8 @@ def test__nc_dataset_in_memory_https():
assert _nc.filepath() == url.split("/")[-1]


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
@pytest.mark.skipif(
platform.system().lower() == "windows",
reason="does not remove the file on windows",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from erddapy.core.url import check_url_response


@pytest.mark.web()
@pytest.mark.xfail()
@pytest.mark.web
@pytest.mark.xfail
def test_servers():
"""Tests if listed servers are responding.
Expand Down
52 changes: 26 additions & 26 deletions tests/test_to_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
dask.config.set(scheduler="single-threaded")


@pytest.fixture()
@pytest.mark.web()
@pytest.fixture
@pytest.mark.web
def sensors():
"""Instantiate ERDDAP class for testing."""
return ERDDAP(
Expand All @@ -24,8 +24,8 @@ def sensors():
)


@pytest.fixture()
@pytest.mark.web()
@pytest.fixture
@pytest.mark.web
def gliders():
"""Instantiate ERDDAP class for testing."""
# The gliders server has 1244 datasets at time of writing
Expand All @@ -35,8 +35,8 @@ def gliders():
)


@pytest.fixture()
@pytest.mark.web()
@pytest.fixture
@pytest.mark.web
def neracoos():
"""Instantiate ERDDAP class for testing."""
return ERDDAP(
Expand All @@ -45,7 +45,7 @@ def neracoos():
)


@pytest.fixture()
@pytest.fixture
def dataset_griddap(neracoos):
"""Load griddap data for testing."""
neracoos.dataset_id = "WW3_EastCoast_latest"
Expand All @@ -54,7 +54,7 @@ def dataset_griddap(neracoos):
return neracoos


@pytest.fixture()
@pytest.fixture
def dataset_opendap(neracoos):
"""Load griddap data with OPeNDAP response for testing."""
neracoos.dataset_id = "WW3_EastCoast_latest"
Expand All @@ -63,7 +63,7 @@ def dataset_opendap(neracoos):
return neracoos


@pytest.fixture()
@pytest.fixture
def dataset_tabledap(sensors):
"""Load tabledap for testing."""
sensors.dataset_id = "amelia_20180501t0000"
Expand All @@ -80,7 +80,7 @@ def dataset_tabledap(sensors):
return sensors


@pytest.mark.web()
@pytest.mark.web
def test_csv_search(gliders):
"""Test if a CSV search returns all items (instead of the first 1000)."""
url = gliders.get_search_url(search_for="all", response="csv")
Expand All @@ -90,7 +90,7 @@ def test_csv_search(gliders):
assert nrows > expected


@pytest.mark.web()
@pytest.mark.web
def test_json_search(gliders):
"""Test if a JSON search returns all items (instead of the first 1000)."""
url = gliders.get_search_url(search_for="all", response="json")
Expand All @@ -100,8 +100,8 @@ def test_json_search(gliders):
assert nrows > expected


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
def test_to_pandas(dataset_tabledap):
"""Test converting tabledap to a pandas DataFrame."""
import pandas as pd
Expand All @@ -117,8 +117,8 @@ def test_to_pandas(dataset_tabledap):
assert df.columns[0] == "temperature (degree_Celsius)"


@pytest.mark.web()
@pytest.mark.vcr()
@pytest.mark.web
@pytest.mark.vcr
def test_to_pandas_requests_kwargs(dataset_tabledap):
"""Test if to_pandas_requests_kwargs are processed as expected."""
import pandas as pd
Expand All @@ -134,7 +134,7 @@ def test_to_pandas_requests_kwargs(dataset_tabledap):
assert is_datetime64_any_dtype(df.index)


@pytest.mark.web()
@pytest.mark.web
def test_to_xarray_tabledap(dataset_tabledap):
"""Test converting tabledap to an xarray Dataset."""
ds = dataset_tabledap.to_xarray()
Expand All @@ -146,7 +146,7 @@ def test_to_xarray_tabledap(dataset_tabledap):
assert ds["temperature"].name == "temperature"


@pytest.mark.web()
@pytest.mark.web
def test_to_xarray_requests_kwargs(dataset_tabledap):
"""Test converting tabledap to an xarray Dataset with manual timeout."""
ds = dataset_tabledap.to_xarray(requests_kwargs={"timeout": 30})
Expand All @@ -158,29 +158,29 @@ def test_to_xarray_requests_kwargs(dataset_tabledap):
assert ds["temperature"].name == "temperature"


@pytest.mark.web()
@pytest.mark.web
def test_to_xarray_griddap(dataset_griddap):
"""Test converting griddap to an xarray Dataset."""
ds = dataset_griddap.to_xarray()
assert isinstance(ds, xr.Dataset)


@pytest.mark.web()
@pytest.mark.web
def test_to_xarray_opendap(dataset_opendap):
"""Test converting griddap to xarray with the OPeNDAP response."""
ds = dataset_opendap.to_xarray()
assert isinstance(ds, xr.Dataset)


@pytest.mark.web()
@pytest.mark.web
def test_to_xarray_opendap_griddap_initialize(dataset_opendap):
"""Test converting griddap aftert calling griddap_initialize."""
dataset_opendap.griddap_initialize()
ds = dataset_opendap.to_xarray()
assert isinstance(ds, xr.Dataset)


@pytest.mark.web()
@pytest.mark.web
@pytest.mark.skipif(
(sys.platform in ("win32", "darwin")),
reason="run this test until we figure out a way to mock it.",
Expand All @@ -197,7 +197,7 @@ def test_to_iris_tabledap(dataset_tabledap):
)


@pytest.mark.web()
@pytest.mark.web
@pytest.mark.skipif(
(sys.platform in ("win32", "darwin")),
reason="run this test until we figure out a way to mock it.",
Expand All @@ -208,7 +208,7 @@ def test_to_iris_griddap(dataset_griddap):
assert isinstance(cubes, iris.cube.CubeList)


@pytest.mark.web()
@pytest.mark.web
def test_download_file(dataset_tabledap):
"""Test file download of tabledap with defined variable and constraints."""
fn = dataset_tabledap.download_file("nc")
Expand All @@ -220,7 +220,7 @@ def test_download_file(dataset_tabledap):
assert fn_new == fn


@pytest.mark.web()
@pytest.mark.web
def test_download_file_variables_only(dataset_tabledap):
"""Test direct download of tabledap dataset with undefined constraints."""
dataset_tabledap.constraints = {}
Expand All @@ -233,7 +233,7 @@ def test_download_file_variables_only(dataset_tabledap):
assert fn_new == fn


@pytest.mark.web()
@pytest.mark.web
def test_download_file_constraints_only(dataset_tabledap):
"""Test direct download of tabledap dataset with undefined variables."""
dataset_tabledap.variables = []
Expand All @@ -246,7 +246,7 @@ def test_download_file_constraints_only(dataset_tabledap):
assert fn_new == fn


@pytest.mark.web()
@pytest.mark.web
def test_download_file_undefined_query(dataset_tabledap):
"""Test direct download of tabledap dataset with undefined query."""
dataset_tabledap.variables = []
Expand Down
Loading

0 comments on commit 714be99

Please sign in to comment.