Skip to content

Remove some checks for Py<3.6 in the test suite. #12974

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
Dec 10, 2018
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
3 changes: 1 addition & 2 deletions lib/matplotlib/tests/test_backend_pdf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os
from pathlib import Path
import sys
import tempfile
import warnings
Expand Down Expand Up @@ -132,9 +133,7 @@ def test_composite_image():
assert len(pdf._file._images) == 2


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6+")
def test_pdfpages_fspath():
from pathlib import Path
with PdfPages(Path(os.devnull)) as pdf:
pdf.savefig(plt.figure())

Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/tests/test_figure.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path
import platform
import sys
import warnings
import platform

from matplotlib import rcParams
from matplotlib.testing.decorators import image_comparison, check_figures_equal
Expand Down Expand Up @@ -412,10 +413,8 @@ def test_add_artist(fig_test, fig_ref):
ax2.add_artist(a)


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6+")
@pytest.mark.parametrize("fmt", ["png", "pdf", "ps", "eps", "svg"])
def test_fspath(fmt, tmpdir):
from pathlib import Path
out = Path(tmpdir, "test.{}".format(fmt))
plt.savefig(out)
with out.open("rb") as file:
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io
import os
import sys
from pathlib import Path
import platform
import urllib.request
import warnings
Expand Down Expand Up @@ -112,10 +113,8 @@ def test_imread_pil_uint16():
assert np.sum(img) == 134184960


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6+")
def test_imread_fspath():
pytest.importorskip("PIL")
from pathlib import Path
img = plt.imread(
Path(__file__).parent / 'baseline_images/test_image/uint16.tif')
assert img.dtype == np.uint16
Expand Down Expand Up @@ -151,10 +150,8 @@ def test_imsave():
assert_array_equal(arr_dpi1, arr_dpi100)


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6+")
@pytest.mark.parametrize("fmt", ["png", "pdf", "ps", "eps", "svg"])
def test_imsave_fspath(fmt):
Path = pytest.importorskip("pathlib").Path
plt.imsave(Path(os.devnull), np.array([[0, 1]]), format=fmt)


Expand Down