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

use unittest.mock instead of mock #1594

Closed
1 task done
pgajdos opened this issue Mar 24, 2022 · 4 comments
Closed
1 task done

use unittest.mock instead of mock #1594

pgajdos opened this issue Mar 24, 2022 · 4 comments

Comments

@pgajdos
Copy link

pgajdos commented Mar 24, 2022

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
  • 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
@ktbyers
Copy link
Contributor

ktbyers commented Mar 24, 2022

I am not really following your issue--you don't want to install and use the Python mock library?

@pgajdos
Copy link
Author

pgajdos commented Mar 25, 2022

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

@mirceaulinic
Copy link
Member

I'm not opposed, feel free to open a PR and we shall review @pgajdos!

@ktbyers
Copy link
Contributor

ktbyers commented Sep 13, 2022

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?

@ktbyers ktbyers closed this as completed Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants