Repository navigation
Conversation
MockPropertyContext.restore() spread the original descriptor and added a value field. For an accessor property this yields an invalid descriptor, so restore() threw a TypeError. When the mock was created with t.mock, the error was thrown while the test was being finalized, before it was reported, and the run hung with no output. Restore the original descriptor as-is. For data properties this is unchanged, since the descriptor already holds the original value. Signed-off-by: sangwook <rewq5991@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67310 +/- ##
==========================================
- Coverage 93.00% 90.67% -2.33%
==========================================
Files 428 797 +369
Lines 195818 279609 +83791
Branches 30283 53783 +23500
==========================================
+ Hits 182117 253543 +71426
- Misses 13375 16350 +2975
- Partials 326 9716 +9390
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MockPropertyContext.restore()spreads the original descriptor and adds avaluefield. For an accessor property that is an invalid descriptor, sorestore()throws aTypeError.With
t.mock, the restore runs while the test is being finalized, before itis reported, so the run hangs with no output:
This restores the original descriptor as-is. Data properties are unaffected,
since their descriptor already holds the original value.
Disclosure: I used a coding agent to help investigate and draft this change. I reproduced the bug on a main build, reviewed the change, and verified that the new tests fail without the fix.