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 #368

Closed
pgajdos opened this issue Apr 20, 2022 · 3 comments
Closed

use unittest.mock instead of mock #368

pgajdos opened this issue Apr 20, 2022 · 3 comments

Comments

@pgajdos
Copy link

pgajdos commented Apr 20, 2022

I see you still support python2, so dropping mock entirely is not option for you, but could you consider to use untitest.mock as a fallback at least, when mock is not installed?

@meejah
Copy link
Owner

meejah commented Apr 20, 2022

Yes, I'd accept a PR to do that :)

And really, I don't think there's a good reason anymore to support python2; major projects that I know that use this already support python3 ... so basically just waiting for "something painful" to simply drop python2 support entirely.

And then it would be nice to get rid of some of the "py3 hoops" that exist, like the separate test/implementation files etc as well

@pgajdos
Copy link
Author

pgajdos commented Apr 21, 2022

I am not sure how the pr should look like then ;). In case you do not consider python2, then
sed -i 's:from mock:from unittest.mock:' test/*.py
do the trick for me on 3.8 to 3.10. In opposite case it is slightly worse, however I am not sure it is worth the work given the statement above. I think it can wait until you decide to drop python2 support.

@meejah
Copy link
Owner

meejah commented Feb 16, 2023

Python2 support is now dropped.

@meejah meejah closed this as completed Apr 27, 2023
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

No branches or pull requests

2 participants