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

Skip setting up a tmpdir in tests that don't need one. #19518

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
Feb 16, 2021
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions 8 lib/matplotlib/tests/test_backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ def test_canvas_ctor():
assert isinstance(FigureCanvasBase().figure, Figure)


def test_get_default_filename(tmpdir):
plt.rcParams['savefig.directory'] = str(tmpdir)
fig = plt.figure()
canvas = FigureCanvasBase(fig)
filename = canvas.get_default_filename()
assert filename == 'image.png'
def test_get_default_filename():
assert plt.figure().canvas.get_default_filename() == 'image.png'


def test_canvas_change():
Expand Down
11 changes: 3 additions & 8 deletions 11 lib/matplotlib/tests/test_backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,11 @@ def test_pdf_eps_savefig_when_color_is_none(fig_test, fig_ref):


@needs_usetex
def test_failing_latex(tmpdir):
def test_failing_latex():
"""Test failing latex subprocess call"""
path = str(tmpdir.join("tmpoutput.pdf"))

rcParams['text.usetex'] = True

# This fails with "Double subscript"
plt.xlabel("$22_2_2$")
plt.xlabel("$22_2_2$", usetex=True) # This fails with "Double subscript"
with pytest.raises(RuntimeError):
plt.savefig(path)
plt.savefig(io.BytesIO(), format="pdf")


def test_empty_rasterized():
Expand Down
5 changes: 2 additions & 3 deletions 5 lib/matplotlib/tests/test_backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,10 @@ def test_tex_restart_after_error():


@needs_xelatex
def test_bbox_inches_tight(tmpdir):
def test_bbox_inches_tight():
fig, ax = plt.subplots()
ax.imshow([[0, 1], [2, 3]])
fig.savefig(os.path.join(tmpdir, "test.pdf"), backend="pgf",
bbox_inches="tight")
fig.savefig(BytesIO(), format="pdf", backend="pgf", bbox_inches="tight")


@needs_xelatex
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.