-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
some way to skip replacing mock with unittest.mock #314
Comments
@mxr ^ thoughts |
I suppose we could hardcode of a list of |
maybe |
But would you want |
only this case because there's a good reason to keep it (%-rewrite could break python2 in some exotic scenarios) -- unless we can actually detect it properly and then we don't need an option |
It should be possible to detect it properly using the approach I outlined |
also mock.patch behaves differently (on 3.6/3.7 Vs pypi mock/3.8) when applied to a coroutinefunction |
Also I don't like an autodetect because I don't want some project files using unittest.mock and others using mock |
thirdly how should other backports be handled? eg functools32 contextlib2 pkg_util_resolve_name etc? |
Good points, sounds like |
when you're using python 3.6 or 3.7
unittest.mock.AsyncMock
is unavailable, butmock.AsyncMock
is available if you're using the latest backportthere should be some way to skip replacing
mock
withunittest.mock
, or the fixer should be moved to--py38-plus
and then to a later--py...-plus
as and whenunittest.mock
gains featuresThe text was updated successfully, but these errors were encountered: