Skip to content

Commit 8eb1369

Browse files
committed
Rename test functions for 1d array input with data
1 parent 9d4eb95 commit 8eb1369

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pygmt/tests/test_plot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def test_plot_fail_no_data(data):
9191
)
9292

9393

94-
def test_plot_fail_color_size_intensity(data):
94+
def test_plot_fail_1d_array_with_data(data):
9595
"""
96-
Should raise an exception if array color, size and intensity are used with
97-
matrix.
96+
Should raise an exception if array color, size, intensity and transparency
97+
are used with matrix.
9898
"""
9999
fig = Figure()
100100
kwargs = dict(data=data, region=region, projection="X10c", frame="afg")
@@ -104,6 +104,8 @@ def test_plot_fail_color_size_intensity(data):
104104
fig.plot(style="cc", size=data[:, 2], color="red", **kwargs)
105105
with pytest.raises(GMTInvalidInput):
106106
fig.plot(style="c0.2c", color="red", intensity=data[:, 2], **kwargs)
107+
with pytest.raises(GMTInvalidInput):
108+
fig.plot(style="c0.2c", color="red", transparency=data[:, 2] * 100, **kwargs)
107109

108110

109111
@pytest.mark.mpl_image_compare

pygmt/tests/test_plot3d.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ def test_plot3d_fail_no_data(data, region):
108108
)
109109

110110

111-
def test_plot3d_fail_color_size_intensity(data, region):
111+
def test_plot3d_fail_1d_array_with_data(data, region):
112112
"""
113-
Should raise an exception if array color, size and intensity are used with
114-
matrix.
113+
Should raise an exception if array color, size, intensity and transparency
114+
are used with matrix.
115115
"""
116116
fig = Figure()
117117
kwargs = dict(data=data, region=region, projection="X10c", frame="afg")
@@ -121,6 +121,8 @@ def test_plot3d_fail_color_size_intensity(data, region):
121121
fig.plot3d(style="cc", size=data[:, 2], color="red", **kwargs)
122122
with pytest.raises(GMTInvalidInput):
123123
fig.plot3d(style="cc", intensity=data[:, 2], color="red", **kwargs)
124+
with pytest.raises(GMTInvalidInput):
125+
fig.plot3d(style="cc", color="red", transparency=data[:, 2] * 100, **kwargs)
124126

125127

126128
@pytest.mark.mpl_image_compare

0 commit comments

Comments
 (0)