-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-99645: Fix a bug in handling class cleanups in unittest.TestCase #99646
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-99645: Fix a bug in handling class cleanups in unittest.TestCase #99646
Conversation
…Case Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the two minor comments mentioned inline the PR looks OK.
'end test1', 'cleanup1']) | ||
|
||
|
||
def test_debug_nested_test(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test appears to test nothing.
class InnerTest(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
ordering.append('setUpClass2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be clearer to change the string to "setup inner" (and likewise for the other numbered strings), that makes it clearer what the expected ordering is.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry @serhiy-storchaka, I had trouble checking out the |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry @serhiy-storchaka, I had trouble checking out the |
…st.TestCase (pythonGH-99646) Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class. (cherry picked from commit c210213) Co-authored-by: Serhiy Storchaka <[email protected]>
…st.TestCase (pythonGH-99646) Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class. (cherry picked from commit c210213) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-99698 is a backport of this pull request to the 3.11 branch. |
…st.TestCase (pythonGH-99646) Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class.. (cherry picked from commit c210213) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-99699 is a backport of this pull request to the 3.10 branch. |
Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class.