From 9994e44df6a8e7174551c08583cefd4a31ed2e22 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 6 Apr 2022 15:08:58 +0200 Subject: [PATCH] TST/CI: simplify geopandas downstream test to not use fiona --- ci/deps/actions-38-downstream_compat.yaml | 2 +- pandas/tests/test_downstream.py | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-38-downstream_compat.yaml index 01415122e6076..629d7b501692d 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-38-downstream_compat.yaml @@ -60,7 +60,7 @@ dependencies: - cftime - dask - ipython - - geopandas + - geopandas-base - seaborn - scikit-learn - statsmodels diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py index 83b476fefea46..b4887cc321785 100644 --- a/pandas/tests/test_downstream.py +++ b/pandas/tests/test_downstream.py @@ -8,7 +8,6 @@ import numpy as np import pytest -from pandas.compat import is_platform_windows import pandas.util._test_decorators as td import pandas as pd @@ -224,20 +223,13 @@ def test_pandas_datareader(): pandas_datareader.DataReader("F", "quandl", "2017-01-01", "2017-02-01") -# importing from pandas, Cython import warning -@pytest.mark.filterwarnings("ignore:can't resolve:ImportWarning") -@pytest.mark.xfail( - is_platform_windows(), - raises=ImportError, - reason="ImportError: the 'read_file' function requires the 'fiona' package, " - "but it is not installed or does not import correctly", - strict=False, -) def test_geopandas(): geopandas = import_module("geopandas") - fp = geopandas.datasets.get_path("naturalearth_lowres") - assert geopandas.read_file(fp) is not None + gdf = geopandas.GeoDataFrame( + {"col": [1, 2, 3], "geometry": geopandas.points_from_xy([1, 2, 3], [1, 2, 3])} + ) + assert gdf[["col", "geometry"]].geometry.x.equals(Series([1.0, 2.0, 3.0])) # Cython import warning