Skip to content

Commit 206c5cc

Browse files
committed
Add tests for invalid inputs
1 parent 2dd366d commit 206c5cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pygmt/tests/test_text.py

+8
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ def test_text_xy_with_position_fails(region):
134134
fig.text(
135135
region=region, projection="x1c", x=1.2, y=2.4, position="MC", text="text"
136136
)
137+
with pytest.raises(GMTInvalidInput):
138+
fig.text(region=region, projection="x1c", textfiles="file.txt", text="text")
139+
with pytest.raises(GMTInvalidInput):
140+
fig.text(region=region, projection="x1c", position="MC", text=None)
141+
with pytest.raises(GMTInvalidInput):
142+
fig.text(
143+
region=region, projection="x1c", position="MC", text=["text1", "text2"]
144+
)
137145

138146

139147
@pytest.mark.mpl_image_compare

0 commit comments

Comments
 (0)