GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The `return_value` docstring is set incorrectly in `unittest.mock.NonCallableMock` · Issue #156970 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
The return_value docstring is set incorrectly in unittest.mock.NonCallableMock#156970
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@IvyXu420
IvyXu420
opened on Sep 5, 2026
Issue body actions

Bug report

Bug description:

cpython/Lib/unittest/mock.py

Lines 596 to 598 in e56f86f

__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

  • gh-156970: Set the docstring of Mock.return_value correctly #156971
  • [3.13] gh-156970: Set Mock.return_value's docstring (GH-156971) #156981
  • [3.14] gh-156970: Set Mock.return_value's docstring (GH-156971) #156982
  • [3.15] gh-156970: Set Mock.return_value's docstring (GH-156971) #156983

Activity

  1. IvyXu420
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Sep 5, 2026
  2. suhanemathur commented on Sep 5, 2026

    @suhanemathur
    suhanemathur
    on Sep 5, 2026
    More actions

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

  3. IvyXu420 commented on Sep 5, 2026

    @IvyXu420
    IvyXu420
    on Sep 5, 2026
    ContributorAuthor
    More actions

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

  4. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Sep 5, 2026
  5. StanFromIreland
    added this to Unittest & doctest issueson Sep 5, 2026
  6. github-project-automation
    moved this to Todo in Unittest & doctest issueson Sep 5, 2026
  7. StanFromIreland
    added a commit that references this issue on Sep 5, 2026

    gh-156970: Set `Mock.return_value`'s docstring (#156971)

    e620377
  8. StanFromIreland
    closed this as completedon Sep 5, 2026
  9. github-project-automation
    moved this from Todo to Done in Unittest & doctest issueson Sep 5, 2026
  10. StanFromIreland
    added 2 commits that reference this issue on Sep 5, 2026

    [3.13] gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (#1…

    0da9c27

    [3.14] gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (#1…

    5532330
  11. hugovk
    added a commit that references this issue on Sep 5, 2026

    [3.15] gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (#1…

    7ad4634
  12. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-156970: Set `Mock.return_value`'s docstring (python#156971)

    d0ff6a1
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/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Unittest & doctest issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.