Skip to content

Commit

Permalink
Merge pull request #1967 from ocefpaf/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
ocefpaf authored Jun 13, 2024
2 parents 66726fd + 389b85a commit 6757906
Showing 1 changed file with 6 additions and 3 deletions.
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")
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

0 comments on commit 6757906

Please sign in to comment.