Skip ghostscript tests on windows

pull/198/head
Vinayak Mehta 2021-07-04 19:40:53 +05:30
parent e76a7a7c26
commit 4c78dadd55
No known key found for this signature in database
GPG Key ID: 2DE013537A15A9A4
3 changed files with 24 additions and 0 deletions

View File

@ -60,6 +60,7 @@ def setup_package():
extras_require={ extras_require={
"all": all_requires, "all": all_requires,
"base": base_requires, "base": base_requires,
"cv": base_requires, # deprecate in v0.12.0
"dev": dev_requires, "dev": dev_requires,
"plot": plot_requires, "plot": plot_requires,
}, },

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import sys
import pandas as pd import pandas as pd
from pandas.testing import assert_frame_equal from pandas.testing import assert_frame_equal
@ -59,6 +60,9 @@ def test_repr_poppler():
def test_repr_ghostscript(): def test_repr_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
filename = os.path.join(testdir, "foo.pdf") filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf( tables = camelot.read_pdf(
filename, backend=ImageConversionBackend(backend="ghostscript") filename, backend=ImageConversionBackend(backend="ghostscript")
@ -77,6 +81,9 @@ def test_url_poppler():
def test_url_ghostscript(): def test_url_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf" url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
tables = camelot.read_pdf( tables = camelot.read_pdf(
url, backend=ImageConversionBackend(backend="ghostscript") url, backend=ImageConversionBackend(backend="ghostscript")
@ -105,6 +112,9 @@ def test_pages_poppler():
def test_pages_ghostscript(): def test_pages_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf" url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
tables = camelot.read_pdf(url) tables = camelot.read_pdf(url)
assert repr(tables) == "<TableList n=1>" assert repr(tables) == "<TableList n=1>"

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import sys
import pytest import pytest
@ -35,6 +36,9 @@ def test_lattice_contour_plot_poppler():
@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True)
def test_lattice_contour_plot_ghostscript(): def test_lattice_contour_plot_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
filename = os.path.join(testdir, "foo.pdf") filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript")) tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript"))
return camelot.plot(tables[0], kind="contour") return camelot.plot(tables[0], kind="contour")
@ -56,6 +60,9 @@ def test_line_plot_poppler():
@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True)
def test_line_plot_ghostscript(): def test_line_plot_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
filename = os.path.join(testdir, "foo.pdf") filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript")) tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript"))
return camelot.plot(tables[0], kind="line") return camelot.plot(tables[0], kind="line")
@ -70,6 +77,9 @@ def test_joint_plot_poppler():
@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True)
def test_joint_plot_ghostscript(): def test_joint_plot_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
filename = os.path.join(testdir, "foo.pdf") filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript")) tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript"))
return camelot.plot(tables[0], kind="joint") return camelot.plot(tables[0], kind="joint")
@ -84,6 +94,9 @@ def test_grid_plot_poppler():
@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True)
def test_grid_plot_ghostscript(): def test_grid_plot_ghostscript():
if sys.platform not in ["linux", "darwin"]:
return True
filename = os.path.join(testdir, "foo.pdf") filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript")) tables = camelot.read_pdf(filename, backend=ImageConversionBackend("ghostscript"))
return camelot.plot(tables[0], kind="grid") return camelot.plot(tables[0], kind="grid")