Skip to content

Commit da6b1fe

Browse files
authored
Merge pull request #20823 from meeseeksmachine/auto-backport-of-pr-20817-on-v3.4.x
Backport PR #20817 on branch v3.4.x (Make test_change_epoch more robust.)
2 parents 7d5754e + 7cf7368 commit da6b1fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/tests/test_dates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,12 +1004,15 @@ def test_datetime64_in_list():
10041004
def test_change_epoch():
10051005
date = np.datetime64('2000-01-01')
10061006

1007+
# use private method to clear the epoch and allow it to be set...
1008+
mdates._reset_epoch_test_example()
1009+
mdates.get_epoch() # Set default.
1010+
10071011
with pytest.raises(RuntimeError):
10081012
# this should fail here because there is a sentinel on the epoch
10091013
# if the epoch has been used then it cannot be set.
10101014
mdates.set_epoch('0000-01-01')
10111015

1012-
# use private method to clear the epoch and allow it to be set...
10131016
mdates._reset_epoch_test_example()
10141017
mdates.set_epoch('1970-01-01')
10151018
dt = (date - np.datetime64('1970-01-01')).astype('datetime64[D]')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy