Skip to content

Commit

Permalink
Remove the unused pygmt.test() function (#2652)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Sep 1, 2023
1 parent a63af1b commit 884e67e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
1 change: 0 additions & 1 deletion doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ Miscellaneous
:toctree: generated

which
test
print_clib_info
show_versions

Expand Down
52 changes: 0 additions & 52 deletions pygmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,55 +182,3 @@ def _get_ghostscript_version():
print(f" ghostscript: {_get_ghostscript_version()}", file=file)

print_clib_info(file=file)


def test(doctest=True, verbose=True, coverage=False, figures=True):
"""
Run the test suite.
Uses `pytest <http://pytest.org/>`__ to discover and run the tests. If you
haven't already, you can install it with `mamba
<https://mamba.readthedocs.org/>`__ or `pip
<https://pip.pypa.io/en/stable/>`__.
Parameters
----------
doctest : bool
If ``True``, will run the doctests as well (code examples that start
with a ``>>>`` in the docs).
verbose : bool
If ``True``, will print extra information during the test run.
coverage : bool
If ``True``, will run test coverage analysis on the code as well.
Requires ``pytest-cov``.
figures : bool
If ``True``, will test generated figures against saved baseline
figures. Requires ``pytest-mpl`` and ``matplotlib``.
Raises
------
AssertionError
If pytest returns a non-zero error code indicating that some tests have
failed.
"""
import pytest # pylint: disable=import-outside-toplevel

show_versions()

package = __name__

args = []
if verbose:
args.append("-vv")
if coverage:
args.append(f"--cov={package}")
args.append("--cov-report=term-missing")
if doctest:
args.append("--doctest-modules")
if figures:
args.append("--mpl")
args.append("--pyargs")
args.append(package)
status = pytest.main(args)
assert status == 0, "Some tests have failed."

0 comments on commit 884e67e

Please sign in to comment.