8000 Merge pull request #20817 from QuLogic/robust-change-epoch · matplotlib/matplotlib@3d5027d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d5027d

Browse files
authored
Merge pull request #20817 from QuLogic/robust-change-epoch
Make test_change_epoch more robust.
2 parents b61e76a + 297921a commit 3d5027d

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
@@ -1095,12 +1095,15 @@ def test_datetime64_in_list():
10951095
def test_change_epoch():
10961096
date = np.datetime64('2000-01-01')
10971097

1098+
# use private method to clear the epoch and allow it to be set...
1099+
mdates._reset_epoch_test_example()
1100+
mdates.get_epoch() # Set default.
1101+
10981102
with pytest.raises(RuntimeError):
10991103
# this should fail here because there is a sentinel on the epoch
11001104
# if the epoch has been used then it cannot be set.
11011105
mdates.set_epoch('0000-01-01')
11021106

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

0 commit comments

Comments
 (0)
0