Skip to content

Commit 6000bb2

Browse files
committed
Test that Pandas normalize raises time errors
1 parent 30bb319 commit 6000bb2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pvlib/tests/test_solarposition.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .conftest import assert_frame_equal, assert_series_equal
99
from numpy.testing import assert_allclose
1010
import pytest
11+
import pytz
1112

1213
from pvlib.location import Location
1314
from pvlib import solarposition, spa
@@ -683,6 +684,10 @@ def test_hour_angle_with_tricky_timezones():
683684
'2014-09-07 10:00:00',
684685
'2014-09-07 11:00:00',
685686
]).tz_localize('America/Santiago')
687+
688+
with pytest.raises(pytz.exceptions.NonExistentTimeError):
689+
times.normalize()
690+
686691
# should not raise `pytz.exceptions.NonExistentTimeError`
687692
solarposition.hour_angle(times, longitude, eot)
688693

@@ -691,6 +696,10 @@ def test_hour_angle_with_tricky_timezones():
691696
'2014-11-02 10:00:00',
692697
'2014-11-02 11:00:00',
693698
]).tz_localize('America/Havana')
699+
700+
with pytest.raises(pytz.exceptions.AmbiguousTimeError):
701+
times.normalize()
702+
694703
# should not raise `pytz.exceptions.AmbiguousTimeError`
695704
solarposition.hour_angle(times, longitude, eot)
696705

0 commit comments

Comments
 (0)