From 76357784d79d03414535d2deea30e987fd700992 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 4 Oct 2021 17:46:45 +0800 Subject: [PATCH] Expand existing tests to test int type colors --- pygmt/tests/test_plot.py | 7 ++++--- pygmt/tests/test_plot3d.py | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pygmt/tests/test_plot.py b/pygmt/tests/test_plot.py index 0cca5fd9bae..a492e4ee593 100644 --- a/pygmt/tests/test_plot.py +++ b/pygmt/tests/test_plot.py @@ -298,8 +298,9 @@ def test_plot_sizes_colors_transparencies(): return fig -@pytest.mark.mpl_image_compare -def test_plot_matrix(data): +@pytest.mark.mpl_image_compare(filename="test_plot_matrix.png") +@pytest.mark.parametrize("color", ["#aaaaaa", 170]) +def test_plot_matrix(data, color): """ Plot the data passing in a matrix and specifying columns. """ @@ -309,7 +310,7 @@ def test_plot_matrix(data): region=[10, 70, -5, 10], projection="M15c", style="cc", - color="#aaaaaa", + color=color, frame="a", incols="0,1,2+s0.005", ) diff --git a/pygmt/tests/test_plot3d.py b/pygmt/tests/test_plot3d.py index 302edd23fcd..a2cce00ea3f 100644 --- a/pygmt/tests/test_plot3d.py +++ b/pygmt/tests/test_plot3d.py @@ -313,7 +313,9 @@ def test_plot3d_sizes_colors_transparencies(): @pytest.mark.mpl_image_compare -def test_plot3d_matrix(data, region): +@pytest.mark.mpl_image_compare(filename="test_plot3d_matrix.png") +@pytest.mark.parametrize("color", ["#aaaaaa", 170]) +def test_plot3d_matrix(data, region, color): """ Plot the data passing in a matrix and specifying incols. """ @@ -325,7 +327,7 @@ def test_plot3d_matrix(data, region): region=region, projection="M20c", style="c1c", - color="#aaaaaa", + color=color, frame=["a", "za"], incols="0,1,2", )