Skip to content

Commit 884e67e

Browse files
authored
Remove the unused pygmt.test() function (#2652)
1 parent a63af1b commit 884e67e

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

doc/api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ Miscellaneous
203203
:toctree: generated
204204

205205
which
206-
test
207206
print_clib_info
208207
show_versions
209208

pygmt/__init__.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -182,55 +182,3 @@ def _get_ghostscript_version():
182182
print(f" ghostscript: {_get_ghostscript_version()}", file=file)
183183

184184
print_clib_info(file=file)
185-
186-
187-
def test(doctest=True, verbose=True, coverage=False, figures=True):
188-
"""
189-
Run the test suite.
190-
191-
Uses `pytest <http://pytest.org/>`__ to discover and run the tests. If you
192-
haven't already, you can install it with `mamba
193-
<https://mamba.readthedocs.org/>`__ or `pip
194-
<https://pip.pypa.io/en/stable/>`__.
195-
196-
Parameters
197-
----------
198-
doctest : bool
199-
If ``True``, will run the doctests as well (code examples that start
200-
with a ``>>>`` in the docs).
201-
verbose : bool
202-
If ``True``, will print extra information during the test run.
203-
coverage : bool
204-
If ``True``, will run test coverage analysis on the code as well.
205-
Requires ``pytest-cov``.
206-
figures : bool
207-
If ``True``, will test generated figures against saved baseline
208-
figures. Requires ``pytest-mpl`` and ``matplotlib``.
209-
210-
Raises
211-
------
212-
213-
AssertionError
214-
If pytest returns a non-zero error code indicating that some tests have
215-
failed.
216-
"""
217-
import pytest # pylint: disable=import-outside-toplevel
218-
219-
show_versions()
220-
221-
package = __name__
222-
223-
args = []
224-
if verbose:
225-
args.append("-vv")
226-
if coverage:
227-
args.append(f"--cov={package}")
228-
args.append("--cov-report=term-missing")
229-
if doctest:
230-
args.append("--doctest-modules")
231-
if figures:
232-
args.append("--mpl")
233-
args.append("--pyargs")
234-
args.append(package)
235-
status = pytest.main(args)
236-
assert status == 0, "Some tests have failed."

0 commit comments

Comments
 (0)