Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cee82fb

Browse filesBrowse files
authored
Merge pull request #15002 from anntzer/testdates
No need to access filesystem in test_dates.py.
2 parents 0f54425 + 64d155b commit cee82fb
Copy full SHA for cee82fb

File tree

Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed

‎lib/matplotlib/tests/test_dates.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_dates.py
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import datetime
2-
import tempfile
32

43
import dateutil.tz
54
import dateutil.rrule
65
import numpy as np
76
import pytest
87

9-
from matplotlib.testing.decorators import image_comparison
10-
import matplotlib.pyplot as plt
8+
from matplotlib import rc_context
119
from matplotlib.cbook import MatplotlibDeprecationWarning
1210
import matplotlib.dates as mdates
11+
import matplotlib.pyplot as plt
12+
from matplotlib.testing.decorators import image_comparison
1313
import matplotlib.ticker as mticker
14-
from matplotlib import rc_context
1514

1615

1716
def test_date_numpyx():
@@ -299,9 +298,8 @@ def test_empty_date_with_year_formatter():
299298
yearFmt = dates.DateFormatter('%Y')
300299
ax.xaxis.set_major_formatter(yearFmt)
301300

302-
with tempfile.TemporaryFile() as fh:
303-
with pytest.raises(ValueError):
304-
fig.savefig(fh)
301+
with pytest.raises(ValueError):
302+
fig.canvas.draw()
305303

306304

307305
def test_auto_date_locator():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.