diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02e1091..506a33d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,4 +36,4 @@ jobs: - name: Full Tests shell: bash -l {0} run: | - python -m pytest -rxs --cov=gliderpy tests + python -m pytest -rxs --cov=gliderpy --vcr-record=none tests diff --git a/requirements-dev.txt b/requirements-dev.txt index c4c6685..b477d3f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -13,6 +13,7 @@ pytest pytest-cov pytest-flake8 pytest-sugar +pytest-vcr pytest-xdist setuptools_scm sphinx diff --git a/tests/test_fetchers.py b/tests/test_fetchers.py index c64a3a4..c14e341 100644 --- a/tests/test_fetchers.py +++ b/tests/test_fetchers.py @@ -12,6 +12,14 @@ def glider_grab(): yield g +@pytest.fixture +@pytest.mark.web +def pandas_dataset(): + glider_grab = GliderDataFetcher() + glider_grab.fetcher.dataset_id = "whoi_406-20160902T1700" + yield glider_grab.to_pandas() + + def test_variables(glider_grab): expected = [ "latitude", @@ -25,10 +33,8 @@ def test_variables(glider_grab): assert sorted(glider_grab.fetcher.variables) == sorted(expected) -def test_standardise_variables_ioos(): - glider_grab = GliderDataFetcher() - glider_grab.fetcher.dataset_id = "whoi_406-20160902T1700" - df = glider_grab.to_pandas() - variables = df.columns +@pytest.mark.vcr(pandas_dataset) +def test_standardise_variables(): + variables = pandas_dataset.columns for var in variables: assert var in server_parameter_rename.values()