Skip to content

Commit

Permalink
Testing: Added test for uncovered line.
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed May 9, 2024
1 parent 7fc0faa commit ac651aa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions diffsims/tests/utils/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,26 @@ def foo(n):
f" {desired_msg}"
)

def test_deprecation_not_function(self):
@deprecated(since=0.7, alternative="bar", removal=0.8, alternative_is_function=False)
def foo(n):
return n + 1

with pytest.warns(np.VisibleDeprecationWarning) as record:
assert foo(4) == 5
desired_msg = (
"Function `foo()` is deprecated and will be removed in version 0.8. Use "
"`bar` instead."
)
assert str(record[0].message) == desired_msg
assert foo.__doc__ == (
"[*Deprecated*] \n"
"\nNotes\n-----\n"
".. deprecated:: 0.7\n"
f" {desired_msg}"
)



class TestDeprecateArgument:
def test_deprecate_argument(self):
Expand Down

0 comments on commit ac651aa

Please sign in to comment.