Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New deprecation warning in tests #2118

Open
bewing opened this issue Jul 16, 2024 · 1 comment · May be fixed by #2120
Open

New deprecation warning in tests #2118

bewing opened this issue Jul 16, 2024 · 1 comment · May be fixed by #2120

Comments

@bewing
Copy link
Member

bewing commented Jul 16, 2024

  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/_pytest/python.py:166: PytestReturnNotNoneWarning: Expected None, but test/ios/test_getters.py::TestGetter::test_get_arp_table[static_arp_entry] returned [{'interface': '', 'mac': '84:B8:02:76:AC:0E', 'ip': '172.29.50.1', 'age': 8.0}, {'interface': 'Vlan20', 'mac': '00:19:07:25:34:4A', 'ip': '172.29.50.2', 'age': 221.0}, {'interface': 'Vlan20', 'mac': '00:24:F7:DD:77:41', 'ip': '172.29.50.3', 'age': -1.0}, {'interface': 'Vlan20', 'mac': '68:05:CA:12:71:C2', 'ip': '172.29.50.10', 'age': 37.0}, {'interface': 'Vlan41', 'mac': '84:B8:02:76:AC:0E', 'ip': '172.29.52.33', 'age': 61.0}, {'interface': 'Vlan41', 'mac': '00:24:F7:DD:77:43', 'ip': '172.29.52.34', 'age': -1.0}, {'interface': 'Vlan41', 'mac': 'A0:99:9B:1C:DF:A7', 'ip': '172.29.52.40', 'age': 3.0}, {'interface': 'Vlan41', 'mac': '00:24:F7:DD:77:43', 'ip': '192.168.81.34', 'age': -1.0}], which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?

we get a warning for every getter test ran.

@bewing
Copy link
Member Author

bewing commented Jul 16, 2024

Probably just need to update the mock_wrapper to return None

bewing added a commit that referenced this issue Jul 16, 2024
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
@bewing bewing linked a pull request Jul 16, 2024 that will close this issue
bewing added a commit that referenced this issue Jul 26, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant