-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-31174: Fix test_tools.test_unparse #4102
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
Conversation
test_unparse.DirectoryTestCase now stores the names sample to always test the same files. It prevents false alarms when hunting reference leaks.
|
|
||
| def test_files(self): | ||
| # get names of files to test | ||
| def get_names(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.
Wouldn't be better to make it a static method?
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.
I prefer to use a regular method, even if technically a staticmethod would work, since the method depends on the 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.
If the method depends on the class, make it a class method.
But in that case you should use cls.NAMES instead of DirectoryTestCase.NAMES.
|
Thanks @Haypo for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
test_unparse.DirectoryTestCase now stores the names sample to always test the same files. It prevents false alarms when hunting reference leaks. (cherry picked from commit 8e482be)
|
GH-4104 is a backport of this pull request to the 3.6 branch. |
test_unparse.DirectoryTestCase now stores the names sample to always
test the same files. It prevents false alarms when hunting reference
leaks.
https://bugs.python.org/issue31174