From 024f690b6d269c11a496db088c4ddd8d5de12a49 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 23 Jul 2020 11:01:38 -0400 Subject: [PATCH] HTTP error for new fsspec (#6446) * Copes with fsspec switching requests -> aiohttp Fixes #6433 * black * Add aiohttp to dev envs --- continuous_integration/environment-3.6.yaml | 1 + continuous_integration/environment-3.7.yaml | 1 + continuous_integration/environment-3.8-dev.yaml | 1 + continuous_integration/environment-3.8.yaml | 1 + dask/bytes/tests/test_http.py | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/continuous_integration/environment-3.6.yaml b/continuous_integration/environment-3.6.yaml index ce2fdc80141..bfc8d72cd97 100644 --- a/continuous_integration/environment-3.6.yaml +++ b/continuous_integration/environment-3.6.yaml @@ -29,6 +29,7 @@ dependencies: - s3fs - boto3 - botocore + - aiohttp - bokeh - httpretty - chest diff --git a/continuous_integration/environment-3.7.yaml b/continuous_integration/environment-3.7.yaml index 5d058c00747..0c548f3095f 100644 --- a/continuous_integration/environment-3.7.yaml +++ b/continuous_integration/environment-3.7.yaml @@ -26,6 +26,7 @@ dependencies: - blosc - boto3 - botocore + - aiohttp - bokeh - httpretty - chest diff --git a/continuous_integration/environment-3.8-dev.yaml b/continuous_integration/environment-3.8-dev.yaml index 4e24dae0dc1..99fda0a244d 100644 --- a/continuous_integration/environment-3.8-dev.yaml +++ b/continuous_integration/environment-3.8-dev.yaml @@ -27,6 +27,7 @@ dependencies: - fsspec>=0.6.0 - boto3 - botocore + - aiohttp - bokeh - httpretty - chest diff --git a/continuous_integration/environment-3.8.yaml b/continuous_integration/environment-3.8.yaml index fb9e520e8bf..e8aeb9d73c5 100644 --- a/continuous_integration/environment-3.8.yaml +++ b/continuous_integration/environment-3.8.yaml @@ -28,6 +28,7 @@ dependencies: - botocore - bokeh - httpretty + - aiohttp - chest - s3fs - cloudpickle diff --git a/dask/bytes/tests/test_http.py b/dask/bytes/tests/test_http.py index 052a669b785..d0015c158a4 100644 --- a/dask/bytes/tests/test_http.py +++ b/dask/bytes/tests/test_http.py @@ -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") @@ -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]