Skip to content

gh-103329: Add regression test for PropertyMock with side effect - #103358

Merged
carljm merged 3 commits into
python:mainfrom
freakboy3742:propertymock_sideeffect
Apr 8, 2023
Merged

carljm merged 3 commits into
python:mainfrom
freakboy3742:propertymock_sideeffect

Conversation

@freakboy3742

@freakboy3742 freakboy3742 commented Apr 8, 2023 •

Copy link
Copy Markdown
Contributor

#102213 introduced an optimisation to __getattr__ that had some unexpected side effects, one of which was a change in behavior of PropertyMock when the property has a side effect.

This change was reverted in #103332; This PR adds a regression test to ensure that PropertyMock behavior is preserved. It also enhances the test of the return value for PropertyMock.

Fixes #103329.

@carljm

carljm commented Apr 8, 2023

Copy link
Copy Markdown
Member

Thanks @freakboy3742! (Also, hello!)

@freakboy3742

Copy link
Copy Markdown
Contributor Author

@carljm 👋

@carljm carljm added the needs backport to 3.11 only security fixes label Apr 8, 2023
@carljm
carljm merged commit 26c6598 into python:main Apr 8, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @freakboy3742 for the PR, and @carljm for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 8, 2023
pythonGH-103358)

(cherry picked from commit 26c6598)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-bot

Copy link
Copy Markdown

GH-103364 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Apr 8, 2023
@freakboy3742
freakboy3742 deleted the propertymock_sideeffect branch April 8, 2023 02:09
miss-islington added a commit that referenced this pull request Apr 8, 2023
…103358)

(cherry picked from commit 26c6598)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants