gh-37883: Safely skip test_resource file size tests when limits are strict#145579
gh-37883: Safely skip test_resource file size tests when limits are strict#145579Shrey-N wants to merge 16 commits intopython:mainfrom
Conversation
|
I have added a news entry, though I am not sure if it's necessary or for this fix, Please let me know if I should remove it :) |
encukou
left a comment
There was a problem hiding this comment.
This looks good!
We don't need a NEWS entry for a test-only change.
|
@encukou Alrighty thank you, I was confused as to add it or not so thank you for clearing that up :), also I will incorporate your reviews in a second :) |
|
I think you can roll back the last 4 commits. In d21ceb8, the removed comment says: That should stay, i.e. the |
|
Alright will look into it asap |
|
@encukou I believe everything should work now :) Sorry for the late reply |
Removed unused import of the 'time' module.
|
@encukou Hi, I believe I fixed the tests that were failing from my side in this PR, I am pretty sure this time, it's not my fault :) lmk if I am to make any other changes :) |
This fixes the Standing issue #37883 where
test_resourcewould fail on systems with file size limitationsPrevious attempts (like #140872) tried to introduce massive refactoring and helper classes. Based on reviewer feedback I read there, I have tried a minimal fix
self.skipTestwith an informative message rather than failing with an unhandledOSErrororValueError.try...finallyresource restoration blocks withself.addCleanup(), guaranteeing that limits are reset even during a test assertion failure.Fixes #37883