Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

3.12.0a7 changes behavior of PropertyMock #103329

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

Description

@freakboy3742

Bug report

3.12.0a7 changed the behavior ofunittest.mock.PropertyMock

Setup:

from unittest.mock import MagicMock, PropertyMockm = MagicMock()p1 = PropertyMock(return_value=3)p2 = PropertyMock(side_effect=ValueError)type(m).foo = p1type(m).bar = p2

In Python 3.12.0a6 and earlier,m.foo evaluates as 3, andm.bar raises a ValueError.

In Python 3.12.0a7,m.foo evaluates as 3, andm.bar returns<MagicMock name='mock.bar' id=...>

Your environment

  • CPython versions tested on: 3.12.0a7, 3.12.0a6, 3.11.2, 3.10.10, 3.9.16, 3.8.16
  • Operating system and architecture:
    • macOS Ventura 13.2.1, on an M1 MacBook Pro.
    • GitHub Actions macOS 12 x86_64
    • GitHub Actions Ubuntu 22.04
    • GitHub Actions Windows Server 2022

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp