-
Notifications
You must be signed in to change notification settings - Fork 41
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
Rename CoroutineMock to CoroutineFunctionMock #103
base: master
Are you sure you want to change the base?
Conversation
There can be existing code like this: isinstance(m, CoroutineMock) and this change should not break it. |
I've yet to find a way to generate the warning without breaking anything: The function breaks isinstance(m, CoroutineMock) but a subclass would break |
26d4557
to
5d0d84d
Compare
I tried different things and I gave up triggering the warning when the symbol is accessed, this will be too complex for a very small benefit. I added the warning when the module is installed, I hope this will be sufficient... |
One option is to provide a custom metaclass with overridden It might cause the trouble to users who subclassed |
5d0d84d
to
6bab0e5
Compare
setup.py
Outdated
@@ -14,3 +14,7 @@ | |||
if __name__ == "__main__": | |||
from setuptools import setup | |||
setup(**args) | |||
|
|||
from warnings import warn | |||
warn("CoroutineMock has been renamed to CoroutineFunctionMock, the alias " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem like a good idea: warns can be turned into exceptions.
6bab0e5
to
28929c7
Compare
The old name is kept for backward-compatibility but will be removed for 1.0.
28929c7
to
dc683d5
Compare
@Martiusweb What do you thing about an alternative approach:
|
c2e9ce1
to
967481c
Compare
It would be good to rediff this PR against master. |
The old name is kept for backward-compatibility but will be removed for 1.0.
Fixes #102