-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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-71339: Use new assertion methods in test_idle #129213
Conversation
Revise 10 tests in 7 files, with 1 test split into 2.
@serhiy-storchaka I did not merge in case there is some reason you did not make all these changes. Feel free to merge. |
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.
LGTM. I propose yet one change:
diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py
index 83ecbffa2a1..7366a4b708c 100644
--- a/Lib/idlelib/idle_test/test_run.py
+++ b/Lib/idlelib/idle_test/test_run.py
@@ -426,7 +426,7 @@ def test_exceptions(self):
ex.runcode('1/0')
t, e, tb = ex.user_exc_info
self.assertIs(t, TypeError)
- self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
+ self.assertIsInstance(e.__context__, ZeroDivisionError)
if __name__ == '__main__':
I will make a separate PR for old specialized methods. There are at least 20 By the 'first one' do you mean the splitting of the condition? It seems that if the conjunction is correct then both separate conditions are correct. The difference is that any error message will be more specific. |
Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Revise 10 tests in 7 files, with 1 test split into 2. (cherry picked from commit dbb25ce) Co-authored-by: Terry Jan Reedy <[email protected]>
GH-129237 is a backport of this pull request to the 3.13 branch. |
Revise 10 tests in 7 files, with 1 test split into 2. (cherry picked from commit dbb25ce) Co-authored-by: Terry Jan Reedy <[email protected]>
GH-129238 is a backport of this pull request to the 3.12 branch. |
Revise 10 tests in 7 files, with 1 test split into 2.