def test_repr_all_missing(): # https://github.com/geopandas/geopandas/issues/1195 s = GeoSeries([None, None, None]) assert "None" in repr(s) df = GeoDataFrame({"a": [1, 2, 3], "geometry": s}) assert "None" in repr(df) assert "geometry" in df._repr_html_()
def test_repr_empty(): # https://github.com/geopandas/geopandas/issues/1195 s = GeoSeries([]) assert repr(s) == "GeoSeries([], dtype: geometry)" df = GeoDataFrame({"a": [], "geometry": s}) assert "Empty GeoDataFrame" in repr(df) # https://github.com/geopandas/geopandas/issues/1184 assert "geometry" in df._repr_html_()
def test_repr_empty(): # https://github.com/geopandas/geopandas/issues/1195 s = GeoSeries([]) if PANDAS_GE_025: # repr with correct name fixed in pandas 0.25 assert repr(s) == "GeoSeries([], dtype: geometry)" else: assert repr(s) == "Series([], dtype: geometry)" df = GeoDataFrame({"a": [], "geometry": s}) assert "Empty GeoDataFrame" in repr(df) # https://github.com/geopandas/geopandas/issues/1184 assert "geometry" in df._repr_html_()