diff --git a/tests/files/baseline_plots/test_grid_plot.png b/tests/files/baseline_plots/test_grid_plot_ghostscript.png similarity index 100% rename from tests/files/baseline_plots/test_grid_plot.png rename to tests/files/baseline_plots/test_grid_plot_ghostscript.png diff --git a/tests/files/baseline_plots/test_grid_plot_poppler.png b/tests/files/baseline_plots/test_grid_plot_poppler.png new file mode 100644 index 0000000..6cf5a39 Binary files /dev/null and b/tests/files/baseline_plots/test_grid_plot_poppler.png differ diff --git a/tests/files/baseline_plots/test_joint_plot.png b/tests/files/baseline_plots/test_joint_plot_ghostscript.png similarity index 100% rename from tests/files/baseline_plots/test_joint_plot.png rename to tests/files/baseline_plots/test_joint_plot_ghostscript.png diff --git a/tests/files/baseline_plots/test_joint_plot_poppler.png b/tests/files/baseline_plots/test_joint_plot_poppler.png new file mode 100644 index 0000000..939ff83 Binary files /dev/null and b/tests/files/baseline_plots/test_joint_plot_poppler.png differ diff --git a/tests/files/baseline_plots/test_lattice_contour_plot.png b/tests/files/baseline_plots/test_lattice_contour_plot_ghostscript.png similarity index 100% rename from tests/files/baseline_plots/test_lattice_contour_plot.png rename to tests/files/baseline_plots/test_lattice_contour_plot_ghostscript.png diff --git a/tests/files/baseline_plots/test_lattice_contour_plot_poppler.png b/tests/files/baseline_plots/test_lattice_contour_plot_poppler.png new file mode 100644 index 0000000..ec6eeb2 Binary files /dev/null and b/tests/files/baseline_plots/test_lattice_contour_plot_poppler.png differ diff --git a/tests/files/baseline_plots/test_line_plot.png b/tests/files/baseline_plots/test_line_plot_ghostscript.png similarity index 100% rename from tests/files/baseline_plots/test_line_plot.png rename to tests/files/baseline_plots/test_line_plot_ghostscript.png diff --git a/tests/files/baseline_plots/test_line_plot_poppler.png b/tests/files/baseline_plots/test_line_plot_poppler.png new file mode 100644 index 0000000..9b24651 Binary files /dev/null and b/tests/files/baseline_plots/test_line_plot_poppler.png differ diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 6283e9e..39525d0 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -5,6 +5,7 @@ import os import pytest import camelot +from camelot.backends.image_conversion import ImageConversionBackend testdir = os.path.dirname(os.path.abspath(__file__)) @@ -26,12 +27,19 @@ def test_textedge_plot(): @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) -def test_lattice_contour_plot(): +def test_lattice_contour_plot_poppler(): filename = os.path.join(testdir, "foo.pdf") tables = camelot.read_pdf(filename) return camelot.plot(tables[0], kind="contour") +@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) +def test_lattice_contour_plot_ghostscript(): + filename = os.path.join(testdir, "foo.pdf") + tables = camelot.read_pdf(filename, backend=ImageConversionBackend('ghostscript')) + return camelot.plot(tables[0], kind="contour") + + @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) def test_stream_contour_plot(): filename = os.path.join(testdir, "tabula/12s0324.pdf") @@ -40,21 +48,42 @@ def test_stream_contour_plot(): @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) -def test_line_plot(): +def test_line_plot_poppler(): filename = os.path.join(testdir, "foo.pdf") tables = camelot.read_pdf(filename) return camelot.plot(tables[0], kind="line") @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) -def test_joint_plot(): +def test_line_plot_ghostscript(): + filename = os.path.join(testdir, "foo.pdf") + tables = camelot.read_pdf(filename, backend=ImageConversionBackend('ghostscript')) + return camelot.plot(tables[0], kind="line") + + +@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) +def test_joint_plot_poppler(): filename = os.path.join(testdir, "foo.pdf") tables = camelot.read_pdf(filename) return camelot.plot(tables[0], kind="joint") @pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) -def test_grid_plot(): +def test_joint_plot_ghostscript(): + filename = os.path.join(testdir, "foo.pdf") + tables = camelot.read_pdf(filename, backend=ImageConversionBackend('ghostscript')) + return camelot.plot(tables[0], kind="joint") + + +@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) +def test_grid_plot_poppler(): filename = os.path.join(testdir, "foo.pdf") tables = camelot.read_pdf(filename) return camelot.plot(tables[0], kind="grid") + + +@pytest.mark.mpl_image_compare(baseline_dir="files/baseline_plots", remove_text=True) +def test_grid_plot_ghostscript(): + filename = os.path.join(testdir, "foo.pdf") + tables = camelot.read_pdf(filename, backend=ImageConversionBackend('ghostscript')) + return camelot.plot(tables[0], kind="grid")