diff --git a/flexmeasures/utils/tests/test_coding_utils.py b/flexmeasures/utils/tests/test_coding_utils.py index 78706d16c..5e2c972bc 100644 --- a/flexmeasures/utils/tests/test_coding_utils.py +++ b/flexmeasures/utils/tests/test_coding_utils.py @@ -2,7 +2,7 @@ def other_function(): - pass + return 1 def test_deprecated_decorator(caplog, app): @@ -10,11 +10,11 @@ def test_deprecated_decorator(caplog, app): # defining a function that is deprecated @deprecated(other_function, "v14") def deprecated_function(): - pass + return other_function() caplog.clear() - deprecated_function() # calling a deprecated function + value = deprecated_function() # calling a deprecated function print(caplog.records) assert len(caplog.records) == 1 # only 1 warning being printed @@ -25,3 +25,7 @@ def deprecated_function(): assert "v14" in str( caplog.records[0].message ) # checking that the message is correct + + assert ( + value == 1 + ) # check that the decorator is returning the value of `other_function`