-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
fix(#753): API documentation for unittest.mock
#754
Conversation
Signed-off-by: Bryant Finney <[email protected]>
unittest.mock
unittest.mock
... by checking for the `__contains__` attribute Signed-off-by: Bryant Finney <[email protected]>
unittest.mock
unittest.mock
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.
Thanks! 🍰
pdoc/doc.py
Outdated
@@ -445,7 +445,7 @@ def _taken_from(self, member_name: str, obj: Any) -> tuple[str, str]: | |||
|
|||
mod = _safe_getattr(obj, "__module__", None) | |||
qual = _safe_getattr(obj, "__qualname__", None) | |||
if mod and qual and "<locals>" not in qual: | |||
if mod and hasattr(qual, "__contains__") and "<locals>" not in qual: |
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.
Do you think
if mod and hasattr(qual, "__contains__") and "<locals>" not in qual: | |
if mod and isinstance(qual, str) and "<locals>" not in qual: |
would maybe be more appropriate here?
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.
Ah yes, nice catch 👍 (should have checked the signature)
... from @mhils during mitmproxy#754 Signed-off-by: Bryant Finney <[email protected]>
... from @mhils during mitmproxy#754 Signed-off-by: Bryant Finney <[email protected]>
2878ac5
to
09fbbae
Compare
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.
Thanks!
Closes #753
Resolve the
TypeError
by testing for the__contains__
attribute