Skip to content

Commit

Permalink
Fix warnings in sunpy.time
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Jan 9, 2020
1 parent 329f372 commit a770c26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sunpy/time/tests/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def test_parse_time_individual_numpy_datetime():


def test_parse_time_numpy_datetime_timezone():
dt64 = np.datetime64('2014-02-07T16:47:51-0500')
with pytest.warns(DeprecationWarning, match='parsing timezone aware datetimes is deprecated'):
dt64 = np.datetime64('2014-02-07T16:47:51-0500')
dt = parse_time(dt64)

assert dt == Time('2014-02-07T21:47:51', format='isot')
Expand Down Expand Up @@ -251,7 +252,6 @@ def test_parse_time_leap_second():
(63072064.184, 'cxcsec'),
(datetime(2000, 1, 2, 12, 0, 0), 'datetime'),
(2000.45, 'decimalyear'),
('2000-01-01T00:00:00.000(TAI)', 'fits'),
(630720013.0, 'gps'),
('2000-01-01 00:00:00.000', 'iso'),
('2000-01-01T00:00:00.000', 'isot'),
Expand Down
4 changes: 3 additions & 1 deletion sunpy/time/tests/test_timerange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import astropy.units as u
from astropy.time import Time, TimeDelta
from astropy.utils.exceptions import ErfaWarning

import sunpy.time
from sunpy.time import is_time_equal
Expand Down Expand Up @@ -258,6 +259,7 @@ def test_contains(timerange_a):
assert timerange.end in timerange
assert '2014/05/04 15:21' in timerange
assert '1975/4/13' not in timerange
assert '2100/1/1'not in timerange
with pytest.warns(ErfaWarning, match='dubious year'):
assert '2100/1/1'not in timerange
assert '2014/05/03 12:00' in timerange
assert '2014/05/05 21:00' in timerange

0 comments on commit a770c26

Please sign in to comment.