Skip to content

Commit

Permalink
pytest wrapper should return None, not result
Browse files Browse the repository at this point in the history
While the wrapper does need the output of the wrapped function for
processing, pytest complains for any test function that returns data.

Updates the wrapper function that processes mocked data to not return
the wrapped function result.

Closes #2118
  • Loading branch information
bewing committed Jul 26, 2024
1 parent 72ba65e commit 39c50fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion napalm/base/test/getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def mock_wrapper(cls, test_case):
attr.current_test = "" # Empty them to avoid side effects
attr.current_test_case = "" # Empty them to avoid side effects

return result
return None

@functools.wraps(func)
def real_wrapper(cls, test_case):
Expand Down

0 comments on commit 39c50fb

Please sign in to comment.