Skip to content

Commit

Permalink
HTTP error for new fsspec (#6446)
Browse files Browse the repository at this point in the history
* Copes with fsspec switching requests -> aiohttp

Fixes #6433

* black

* Add aiohttp to dev envs
  • Loading branch information
martindurant committed Jul 23, 2020
1 parent f212b76 commit 024f690
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions continuous_integration/environment-3.6.yaml
Expand Up @@ -29,6 +29,7 @@ dependencies:
- s3fs
- boto3
- botocore
- aiohttp
- bokeh
- httpretty
- chest
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-3.7.yaml
Expand Up @@ -26,6 +26,7 @@ dependencies:
- blosc
- boto3
- botocore
- aiohttp
- bokeh
- httpretty
- chest
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-3.8-dev.yaml
Expand Up @@ -27,6 +27,7 @@ dependencies:
- fsspec>=0.6.0
- boto3
- botocore
- aiohttp
- bokeh
- httpretty
- chest
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-3.8.yaml
Expand Up @@ -28,6 +28,7 @@ dependencies:
- botocore
- bokeh
- httpretty
- aiohttp
- chest
- s3fs
- cloudpickle
Expand Down
6 changes: 5 additions & 1 deletion dask/bytes/tests/test_http.py
Expand Up @@ -12,6 +12,10 @@

files = ["a", "b"]
requests = pytest.importorskip("requests")
errs = (requests.exceptions.RequestException,)
if LooseVersion(fsspec.__version__) > "0.7.4":
aiohttp = pytest.importorskip("aiohttp")
errs = errs + (aiohttp.client_exceptions.ClientResponseError,)


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -112,7 +116,7 @@ def test_ops_blocksize(dir_server):

def test_errors(dir_server):
f = open_files("http://localhost:8999/doesnotexist")[0]
with pytest.raises(requests.exceptions.RequestException):
with pytest.raises(errs):
with f as f:
f.read()
f = open_files("http://nohost/")[0]
Expand Down

0 comments on commit 024f690

Please sign in to comment.