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

gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__#120019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cjw296 merged 3 commits intopython:mainfromblhsing:fix-propertymock-attach-call
Jun 11, 2024

Conversation

@blhsing
Copy link
Contributor

@blhsingblhsing commentedJun 4, 2024
edited by bedevere-appbot
Loading

Avoid triggering call to aPropertyMock inNonCallableMock.__setattr__

Previously attaching aPropertyMock to a mock object would trigger a call to the property mock due to a recursive__setattr__ call.

This is now fixed by setting the given property mock as an attribute of the hosting mock directly in its__dict__ instead.

Copy link
Contributor

@cjw296cjw296 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. Do you consider this a bugfix or a feature improvement?

@blhsing
Copy link
ContributorAuthor

LGTM. Do you consider this a bugfix or a feature improvement?

Thanks. I believe this is a bug (it was filed as one) since it should be expected that aPropertyMock does not trigger a call just by attaching it to another mock object, a common initialization setup.

@cjw296cjw296 added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsJun 11, 2024
@cjw296cjw296enabled auto-merge (squash)June 11, 2024 05:42
@cjw296cjw296 merged commit9e9ee50 intopython:mainJun 11, 2024
@miss-islington-app
Copy link

Thanks@blhsing for the PR, and@cjw296 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

blhsing reacted with thumbs up emoji

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 11, 2024
…eMock.__setattr__ (pythonGH-120019)(cherry picked from commit9e9ee50)Co-authored-by: blhsing <blhsing@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 11, 2024
…eMock.__setattr__ (pythonGH-120019)(cherry picked from commit9e9ee50)Co-authored-by: blhsing <blhsing@gmail.com>
@bedevere-app
Copy link

GH-120336 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJun 11, 2024
@bedevere-app
Copy link

GH-120337 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJun 11, 2024
cjw296 pushed a commit that referenced this pull requestJun 11, 2024
…leMock.__setattr__ (GH-120019) (#120337)gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__ (GH-120019)(cherry picked from commit9e9ee50)Co-authored-by: blhsing <blhsing@gmail.com>
cjw296 pushed a commit that referenced this pull requestJun 11, 2024
…leMock.__setattr__ (GH-120019) (#120336)gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__ (GH-120019)(cherry picked from commit9e9ee50)Co-authored-by: blhsing <blhsing@gmail.com>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull requestJun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cjw296cjw296cjw296 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@blhsing@cjw296

[8]ページ先頭

©2009-2025 Movatter.jp