Skip to content

Commit f8293cd

Browse files
committed
Add one test with the deprecated 'required_z' parameter to increase code coverage
1 parent 0e0c1d8 commit f8293cd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pygmt/tests/test_clib_virtualfile_in.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ def test_virtualfile_in_required_z_matrix_missing():
6666
pass
6767

6868

69+
# TODO(PyGMT>=0.20.0): Remove this test for the deprecated 'required_z' parameter.
70+
def test_virtualfile_in_required_z_deprecated():
71+
"""
72+
Same as test_virtualfile_in_required_z_matrix_missing but using the deprecated
73+
'required_z' parameter.
74+
"""
75+
data = np.ones((5, 2))
76+
with clib.Session() as lib:
77+
with pytest.raises(GMTInvalidInput): # noqa: PT012
78+
with pytest.warns(FutureWarning):
79+
with lib.virtualfile_in(
80+
data=data, required_z=True, check_kind="vector"
81+
):
82+
pass
83+
84+
6985
def test_virtualfile_in_fail_non_valid_data(data):
7086
"""
7187
Should raise an exception if too few or too much data is given.

0 commit comments

Comments
 (0)