napalm
napalm copied to clipboard
use unittest.mock instead of mock
Description of Issue/Question
Could you please consider to use unittest.mock instead of mock, as a fallback at least?
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
(Place an x between the square brackets where applicable)
- [] Yes
- [x] No
Setup
napalm version
(Paste verbatim output from pip freeze | grep napalm between quotes below)
git master
Network operating system version
(Paste verbatim output from show version - or equivalent - between quotes below)
N/A
Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)
run the testsuite without python-mock installed
I am not really following your issue--you don't want to install and use the Python mock library?
Yes, this issue is meant this way: in case mock is not available, we could use built-in unittest.mock instead.
JFYI, I tried just mock -> unittest.mock (https://build.opensuse.org/package/view_file/home:pgajdos:python/python-napalm/python-napalm-no-mock.patch) and this works at least for 3.{8,9,10}. Background: https://trello.com/b/WsskhdXA/opensuse-python
I'm not opposed, feel free to open a PR and we shall review @pgajdos!
Yeah, I am not opposed to this either, but you would probably need to do the pull-request on it.
This is entirely a NAPALM development dependency so not sure why you care?