Thanks to visit codestin.com
Credit goes to github.com

Skip to content

No need to access filesystem in test_dates.py. #15002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import datetime
import tempfile

import dateutil.tz
import dateutil.rrule
import numpy as np
import pytest

from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
from matplotlib import rc_context
from matplotlib.cbook import MatplotlibDeprecationWarning
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
import matplotlib.ticker as mticker
from matplotlib import rc_context


def test_date_numpyx():
Expand Down Expand Up @@ -299,9 +298,8 @@ def test_empty_date_with_year_formatter():
yearFmt = dates.DateFormatter('%Y')
ax.xaxis.set_major_formatter(yearFmt)

with tempfile.TemporaryFile() as fh:
with pytest.raises(ValueError):
fig.savefig(fh)
with pytest.raises(ValueError):
fig.canvas.draw()


def test_auto_date_locator():
Expand Down