Title: 3.12.0a7 changes behavior of PropertyMock · Issue #103329 · python/cpython · GitHub
Open Graph Title: 3.12.0a7 changes behavior of PropertyMock · Issue #103329 · python/cpython
X Title: 3.12.0a7 changes behavior of PropertyMock · Issue #103329 · python/cpython
Description: Bug report 3.12.0a7 changed the behavior of unittest.mock.PropertyMock Setup: from unittest.mock import MagicMock, PropertyMock m = MagicMock() p1 = PropertyMock(return_value=3) p2 = PropertyMock(side_effect=ValueError) type(m).foo = p1 ...
Open Graph Description: Bug report 3.12.0a7 changed the behavior of unittest.mock.PropertyMock Setup: from unittest.mock import MagicMock, PropertyMock m = MagicMock() p1 = PropertyMock(return_value=3) p2 = PropertyMock(s...
X Description: Bug report 3.12.0a7 changed the behavior of unittest.mock.PropertyMock Setup: from unittest.mock import MagicMock, PropertyMock m = MagicMock() p1 = PropertyMock(return_value=3) p2 = PropertyMock(s...
Opengraph URL: https://github.com/python/cpython/issues/103329
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"3.12.0a7 changes behavior of PropertyMock","articleBody":"# Bug report\r\n\r\n3.12.0a7 changed the behavior of `unittest.mock.PropertyMock`\r\n\r\nSetup:\r\n```\r\nfrom unittest.mock import MagicMock, PropertyMock\r\nm = MagicMock()\r\np1 = PropertyMock(return_value=3)\r\np2 = PropertyMock(side_effect=ValueError)\r\ntype(m).foo = p1\r\ntype(m).bar = p2\r\n```\r\n\r\nIn Python 3.12.0a6 and earlier, `m.foo` evaluates as 3, and `m.bar` raises a ValueError.\r\n\r\nIn Python 3.12.0a7, `m.foo` evaluates as 3, and `m.bar` returns `\u003cMagicMock name='mock.bar' id=...\u003e`\r\n\r\n# Your environment\r\n\r\n- CPython versions tested on: 3.12.0a7, 3.12.0a6, 3.11.2, 3.10.10, 3.9.16, 3.8.16\r\n- Operating system and architecture: \r\n - macOS Ventura 13.2.1, on an M1 MacBook Pro.\r\n - GitHub Actions macOS 12 x86_64 \r\n - GitHub Actions Ubuntu 22.04\r\n - GitHub Actions Windows Server 2022\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103358\n* gh-103364\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/freakboy3742","@type":"Person","name":"freakboy3742"},"datePublished":"2023-04-07T04:02:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/103329/cpython/issues/103329"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:25387f4b-f846-1aba-4a5d-10de226e44db |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A18:13A77B:40DDE:57A46:6969CAB6 |
| html-safe-nonce | baa4e0ee2a7fa219f53d269d42e10c5245485e2588628c7b41a21b635bcdaa22 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTE4OjEzQTc3Qjo0MERERTo1N0E0Njo2OTY5Q0FCNiIsInZpc2l0b3JfaWQiOiI5MTA4MTA5MzkyODY5OTY4NTY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 84711ab7163b3f8ebfe5783fa0c96111a85817ef8afa8cbedde170f66aa99dc6 |
| hovercard-subject-tag | issue:1658331435 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b92147d2a6580c3a98b6cb0b103ab23dd8eca6011c18ba13881197dd6aee7489/python/cpython/issues/103329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b92147d2a6580c3a98b6cb0b103ab23dd8eca6011c18ba13881197dd6aee7489/python/cpython/issues/103329 |
| og:image:alt | Bug report 3.12.0a7 changed the behavior of unittest.mock.PropertyMock Setup: from unittest.mock import MagicMock, PropertyMock m = MagicMock() p1 = PropertyMock(return_value=3) p2 = PropertyMock(s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | freakboy3742 |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width