Skip to content

Commit 5dcbbc2

Browse files
committed
updated tests to handle pandas-dev/pandas#49677
1 parent be906d4 commit 5dcbbc2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

geopandas/io/tests/test_file.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import geopandas
1818
from geopandas import GeoDataFrame, read_file
19+
from geopandas._compat import PANDAS_GE_20
1920
from geopandas.io.file import _detect_driver, _EXTENSION_TO_DRIVER
2021

2122
from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal
@@ -309,7 +310,11 @@ def test_read_file_datetime_mixed_offsets(tmpdir):
309310
if FIONA_GE_1814:
310311
# Convert mixed timezones to UTC equivalent
311312
assert is_datetime64_any_dtype(res["date"])
312-
assert res["date"].dt.tz == pytz.utc
313+
if not PANDAS_GE_20:
314+
utc = pytz.utc
315+
else:
316+
utc = datetime.timezone.utc
317+
assert res["date"].dt.tz == utc
313318
else:
314319
# old fiona and pyogrio ignore timezones and read as datetimes successfully
315320
assert is_datetime64_any_dtype(res["date"])

0 commit comments

Comments
 (0)