Skip to content

Commit 14a4947

Browse files
Meghan Jonesmichaelgrund
andauthored
Increase code coverage for grdtrack tests (#1782)
Co-authored-by: Michael Grund <[email protected]>
1 parent 76cb362 commit 14a4947

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

pygmt/tests/test_grdtrack.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,14 @@ def test_grdtrack_input_dataframe_and_ncfile(dataframe, expected_array):
8989
npt.assert_allclose(np.array(output), expected_array)
9090

9191

92-
def test_grdtrack_input_csvfile_and_ncfile(expected_array):
92+
def test_grdtrack_input_csvfile_and_ncfile_to_dataframe(expected_array):
9393
"""
94-
Run grdtrack by passing in a csvfile and netcdf file as inputs.
94+
Run grdtrack by passing in a csv file and netcdf file as inputs with a
95+
pandas.DataFrame output.
9596
"""
96-
with GMTTempFile() as tmpfile:
97-
output = grdtrack(
98-
points=POINTS_DATA, grid="@static_earth_relief.nc", outfile=tmpfile.name
99-
)
100-
assert output is None # check that output is None since outfile is set
101-
assert os.path.exists(path=tmpfile.name) # check that outfile exists at path
102-
output = np.loadtxt(tmpfile.name)
103-
npt.assert_allclose(np.array(output), expected_array)
97+
output = grdtrack(points=POINTS_DATA, grid="@static_earth_relief.nc")
98+
assert isinstance(output, pd.DataFrame)
99+
npt.assert_allclose(np.array(output), expected_array)
104100

105101

106102
def test_grdtrack_wrong_kind_of_points_input(dataarray, dataframe):

0 commit comments

Comments
 (0)