FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove some checks for Py<3.6 in the test suite. by anntzer · Pull Request #12974 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 1 addition & 2 deletions lib/matplotlib/tests/test_backend_pdf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL