Skip to content

Commit 362e5bd

Browse files
committed
Figure.plot3d: Add one more test to increase code coverage
1 parent 2cb9295 commit 362e5bd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pygmt/tests/test_plot3d.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ def test_plot3d_fail_1d_array_with_data(data, region):
8888
fig.plot3d(style="cc", fill="red", transparency=data[:, 2] * 100, **kwargs)
8989

9090

91+
def test_plot3d_fail_no_data(data, region):
92+
"""
93+
Should raise an exception if data is not enough.
94+
"""
95+
fig = Figure()
96+
with pytest.raises(GMTInvalidInput):
97+
fig.plot3d(
98+
style="c0.2c", x=data[0], y=data[1], region=region, projection="X10c"
99+
)
100+
with pytest.raises(GMTInvalidInput):
101+
fig.plot3d(
102+
style="c0.2c", data=data, x=data[0], region=region, projection="X10c"
103+
)
104+
105+
91106
@pytest.mark.mpl_image_compare
92107
def test_plot3d_projection(data, region):
93108
"""

0 commit comments

Comments
 (0)