Skip to content

Commit

Permalink
Deprecate the verde.test function (#344)
Browse files Browse the repository at this point in the history
It's not needed and hardly ever used. The same functionality can be
achieved with `pytest --pyargs verde` (testing the installed version).
Will be removed in v2.0.0.
  • Loading branch information
leouieda authored Dec 23, 2021
1 parent 6db6ba2 commit 13a1779
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions verde/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def test(doctest=True, verbose=True, coverage=False, figures=True):
failed.
"""
import warnings

import pytest

package = __name__
Expand All @@ -83,4 +85,12 @@ def test(doctest=True, verbose=True, coverage=False, figures=True):
args.append("--pyargs")
args.append(package)
status = pytest.main(args)

warnings.warn(
f"The '{package}.test' function is deprecated since v1.7.0 and "
"will be removed in v2.0.0. "
f"Use 'pytest --pyargs {package}' to run the tests.",
FutureWarning,
)

assert status == 0, "Some tests have failed."

0 comments on commit 13a1779

Please sign in to comment.