Skip to content

Commit fbb7bb3

Browse files
committed
add test for tz-aware inputs
1 parent 1418273 commit fbb7bb3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/iotools/test_merra2.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,16 @@ def test_get_merra2_error():
6868
pvlib.iotools.get_merra2(40, -80, '2019-12-31', '2020-01-02',
6969
username='anything', password='anything',
7070
dataset='anything', variables=[])
71+
72+
73+
@requires_earthdata_credentials
74+
@pytest.mark.remote_data
75+
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
76+
def test_get_merra2_timezones(params, expected, expected_meta):
77+
# check with tz-aware start/end inputs
78+
for key in ['start', 'end']:
79+
dt = pd.to_datetime(params[key])
80+
params[key] = dt.tz_localize('UTC').tz_convert('Etc/GMT+5')
81+
df, meta = pvlib.iotools.get_merra2(**params)
82+
pd.testing.assert_frame_equal(df, expected, check_freq=False)
83+
assert meta == expected_meta

0 commit comments

Comments
 (0)