diff --git a/omnipath/_core/downloader/_downloader.py b/omnipath/_core/downloader/_downloader.py index bda83f3..71f0bbe 100644 --- a/omnipath/_core/downloader/_downloader.py +++ b/omnipath/_core/downloader/_downloader.py @@ -142,8 +142,8 @@ def maybe_download( try: res = self._download(req) except RequestException: - logging.warn(f"Failed to download from `{domain}`.") - logging.warn(traceback.format_exc()) + logging.warning(f"Failed to download from `{domain}`.") + logging.warning(traceback.format_exc()) continue res = callback(res) if cache: diff --git a/tests/test_downloader.py b/tests/test_downloader.py index 3fab46b..12e9bee 100644 --- a/tests/test_downloader.py +++ b/tests/test_downloader.py @@ -166,7 +166,7 @@ def test_fallback_urls(self, requests_mock, csv_data: bytes): downloader = Downloader(opt) res = downloader.maybe_download(query, callback=pd.read_csv) - assert requests_mock.called_once + assert requests_mock.called np.testing.assert_array_equal(res.index, csv_df.index) np.testing.assert_array_equal(res.columns, csv_df.columns) np.testing.assert_array_equal(res.values, csv_df.values) diff --git a/tests/test_requests.py b/tests/test_requests.py index 13f983c..4a14c68 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -6,7 +6,7 @@ import pytest -from pandas.api.types import is_object_dtype, is_categorical_dtype +from pandas.api.types import is_object_dtype import numpy as np import pandas as pd @@ -144,7 +144,7 @@ def test_no_dtype_conversion(self, cache_backup, requests_mock, tsv_data: bytes) options.convert_dtypes = True res = Enzsub.get() - assert is_categorical_dtype(res["modification"]) + assert isinstance(res["modification"].dtype, pd.CategoricalDtype) assert requests_mock.called_once