Skip to content

Commit dcd5e4c

Browse files
committed
add new test
1 parent 0be992e commit dcd5e4c

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

pygmt/tests/test_plot.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ def test_plot_matrix(data):
309309
projection="M15c",
310310
style="cc",
311311
color="#aaaaaa",
312-
B="a",
313-
columns="0,1,2+s0.005",
312+
frame="a",
313+
incols="0,1,2+s0.005",
314314
)
315315
return fig
316316

@@ -327,7 +327,7 @@ def test_plot_matrix_color(data):
327327
projection="X10c",
328328
style="c0.5c",
329329
cmap="rainbow",
330-
B="a",
330+
frame="a",
331331
)
332332
return fig
333333

@@ -345,7 +345,7 @@ def test_plot_from_file(region):
345345
style="d1c",
346346
color="yellow",
347347
frame=True,
348-
columns=[0, 1],
348+
incols=[0, 1],
349349
)
350350
return fig
351351

@@ -453,7 +453,7 @@ def test_plot_datetime():
453453
@pytest.mark.mpl_image_compare(filename="test_plot_sizes.png")
454454
def test_plot_deprecate_sizes_to_size(data, region):
455455
"""
456-
Make sure that the old parameter "sizes" is supported and it reports an
456+
Make sure that the old parameter "sizes" is supported and it reports a
457457
warning.
458458
459459
Modified from the test_plot_sizes() test.
@@ -472,3 +472,26 @@ def test_plot_deprecate_sizes_to_size(data, region):
472472
)
473473
assert len(record) == 1 # check that only one warning was raised
474474
return fig
475+
476+
477+
@pytest.mark.mpl_image_compare(filename="test_plot_from_file.png")
478+
def test_plot_deprecate_columns_to_incols(region):
479+
"""
480+
Make sure that the old parameter "columns" is supported and it reports a
481+
warning.
482+
483+
Modified from the test_plot_from_file() test.
484+
"""
485+
fig = Figure()
486+
with pytest.warns(expected_warning=FutureWarning) as record:
487+
fig.plot(
488+
data=POINTS_DATA,
489+
region=region,
490+
projection="X10c",
491+
style="d1c",
492+
color="yellow",
493+
frame=True,
494+
columns=[0, 1],
495+
)
496+
assert len(record) == 1 # check that only one warning was raised
497+
return fig

0 commit comments

Comments
 (0)