Skip to content

The return_value docstring is set incorrectly in unittest.mock.NonCallableMock #156970

Closed

Description

@IvyXu420

Bug report

Bug description:

__return_value_doc = "The value to be returned when the mock is called."
return_value = property(__get_return_value, __set_return_value,
__return_value_doc)

Should be:

 return_value = property(__get_return_value, __set_return_value, 
                         doc=__return_value_doc)

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. suhanemathur commented on Sep 5, 2026

    @suhanemathur

    Hi! @ByteFlowing1337 , I would like to take this issue up.

  2. IvyXu420 commented on Sep 5, 2026

    @IvyXu420
    ContributorAuthor

    @suhanemathur Sorry, but I already made a PR: #156971

  3. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Sep 5, 2026
  4. added a commit that references this issue on Sep 5, 2026
  5. added 2 commits that reference this issue on Sep 5, 2026
  6. added a commit that references this issue on Sep 5, 2026
  7. added a commit that references this issue on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions