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

Support mocked decorator for class methods #10313

Conversation

GutiCW
Copy link

@GutiCW GutiCW commented Mar 31, 2022

Subject: support mocked decorator for class methods

Feature or Bugfix

  • Feature

Purpose

  • Before this PR, class methods decorated with mocked functions were not shown in the generated documentation.

Detail

  • Consider bound methods in ismock() to handle this specific case.

Relates

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a testcase to tests/test_ext_autodoc_mock.py, please?

sphinx/ext/autodoc/mock.py Outdated Show resolved Hide resolved
sphinx/ext/autodoc/mock.py Outdated Show resolved Hide resolved
@GutiCW
Copy link
Author

GutiCW commented Apr 1, 2022

Could you add a testcase to tests/test_ext_autodoc_mock.py, please?

Done, if my test extension suffices.

@GutiCW
Copy link
Author

GutiCW commented Apr 1, 2022

Fyi, with my last commit (5a29334) I removed the recursive call as it is actually not necessary.

@GutiCW GutiCW requested a review from tk0miya April 1, 2022 05:50
@tk0miya tk0miya changed the base branch from 4.x to 5.x April 3, 2022 08:09
@tk0miya tk0miya merged commit 020a1f9 into sphinx-doc:5.x Apr 3, 2022
@tk0miya
Copy link
Member

tk0miya commented Apr 3, 2022

Thank you for your contribution. Good work!

tk0miya added a commit that referenced this pull request Apr 3, 2022
@GutiCW GutiCW deleted the feature-support_mocked_decorator_for_class_methods branch April 7, 2022 10:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants