Skip to content

Commit

Permalink
Tests: Suppress warnings by explicitly setting output_type to 'file' (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Mar 23, 2024
1 parent 32e3cb3 commit 1eb6dec
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions pygmt/tests/test_blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_blockmean_input_filename():
data="@tut_ship.xyz",
spacing="5m",
region=[245, 255, 20, 30],
output_type="file",
outfile=tmpfile.name,
)
assert output is None # check that output is None since outfile is set
Expand Down
1 change: 1 addition & 0 deletions pygmt/tests/test_blockmedian.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_blockmedian_input_filename():
data="@tut_ship.xyz",
spacing="5m",
region=[245, 255, 20, 30],
output_type="file",
outfile=tmpfile.name,
)
assert output is None # check that output is None since outfile is set
Expand Down
4 changes: 3 additions & 1 deletion pygmt/tests/test_grdtrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def test_grdtrack_input_csvfile_and_dataarray(dataarray, expected_array):
Run grdtrack by passing in a csvfile and xarray.DataArray as inputs.
"""
with GMTTempFile() as tmpfile:
output = grdtrack(points=POINTS_DATA, grid=dataarray, outfile=tmpfile.name)
output = grdtrack(
points=POINTS_DATA, grid=dataarray, output_type="file", outfile=tmpfile.name
)
assert output is None # check that output is None since outfile is set
assert Path(tmpfile.name).stat().st_size > 0 # check that outfile exists
output = np.loadtxt(tmpfile.name)
Expand Down
1 change: 1 addition & 0 deletions pygmt/tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_project_output_filename(dataframe):
center=[0, -1],
azimuth=45,
flat_earth=True,
output_type="file",
outfile=tmpfile.name,
)
assert output is None # check that output is None since outfile is set
Expand Down
1 change: 1 addition & 0 deletions pygmt/tests/test_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_select_input_filename():
data="@tut_ship.xyz",
region=[250, 251, 26, 27],
z_subregion=["-/-630", "-120/0+a"],
output_type="file",
outfile=tmpfile.name,
)
assert output is None # check that output is None since outfile is set
Expand Down

0 comments on commit 1eb6dec

Please sign in to comment.