Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #1967

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/plugins/test_time_slider_choropleth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"""

import json
import sys

import numpy as np
import pandas as pd
import pytest
from branca.colormap import linear

import folium
from folium.plugins import TimeSliderChoropleth
from folium.utilities import normalize


@pytest.mark.xfail(sys.version_info[0:2] == (3, 8), reason="too modern for py38")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably drop Python 3.8 in October at its EOL. This should be fine for now.

def test_timedynamic_geo_json():
"""
tests folium.plugins.TimeSliderChoropleth
"""
import geodatasets
import geopandas as gpd

assert "naturalearth_lowres" in gpd.datasets.available
datapath = gpd.datasets.get_path("naturalearth_lowres")
datapath = geodatasets.get_path("naturalearth land")
gdf = gpd.read_file(datapath)

"""
Expand All @@ -32,7 +35,7 @@ def test_timedynamic_geo_json():
datetime.strftime('%s') on Windows just generates date and not timestamp so avoid.
"""
n_periods = 3
dt_range = pd.Series(pd.date_range("2001-08-1", periods=n_periods, freq="M"))
dt_range = pd.Series(pd.date_range("2001-08-1", periods=n_periods, freq="ME"))
dt_index = [f"{dt.timestamp():.0f}" for dt in dt_range]

styledata = {}
Expand Down