Skip to content

Commit

Permalink
Mark tests requiring network
Browse files Browse the repository at this point in the history
Those tests also require network and should be excluded when running
`pytest -m 'not network'`.
  • Loading branch information
penguinpee committed May 17, 2024
1 parent 78945b7 commit 01ba8c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pooch/tests/test_downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_unsupported_protocol():
with pytest.raises(ValueError):
choose_downloader("doii:XXX/XXX/file")


@pytest.mark.network
def test_invalid_doi_repository():
"Should fail if data repository is not supported"
with pytest.raises(ValueError) as exc:
Expand All @@ -96,6 +96,7 @@ def test_invalid_doi_repository():
assert "Invalid data repository 'joss.theoj.org'" in str(exc.value)


@pytest.mark.network
def test_doi_url_not_found():
"Should fail if the DOI is not found"
with pytest.raises(ValueError) as exc:
Expand All @@ -112,6 +113,7 @@ def test_doi_url_not_found():
],
ids=["figshare", "zenodo", "dataverse"],
)
@pytest.mark.network
def test_figshare_url_file_not_found(repository, doi):
"Should fail if the file is not found in the archive"
with pytest.raises(ValueError) as exc:
Expand All @@ -126,6 +128,7 @@ def test_figshare_url_file_not_found(repository, doi):
[FIGSHAREURL, ZENODOURL, DATAVERSEURL],
ids=["figshare", "zenodo", "dataverse"],
)
@pytest.mark.network
def test_doi_downloader(url):
"Test the DOI downloader"
# Use the test data we have on the repository
Expand Down

0 comments on commit 01ba8c1

Please sign in to comment.