Skip to content

bpo-31174: Fix test_tools.test_unparse#4102

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:test_unparse
Oct 24, 2017
Merged

bpo-31174: Fix test_tools.test_unparse#4102
vstinner merged 1 commit into
python:masterfrom
vstinner:test_unparse

Conversation

@vstinner

@vstinner vstinner commented Oct 24, 2017

Copy link
Copy Markdown
Member

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

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):

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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.

@vstinner vstinner merged commit 8e482be into python:master Oct 24, 2017
@vstinner vstinner deleted the test_unparse branch October 24, 2017 10:33
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @Haypo for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 24, 2017
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)
@bedevere-bot

Copy link
Copy Markdown

GH-4104 is a backport of this pull request to the 3.6 branch.

vstinner pushed a commit that referenced this pull request Oct 24, 2017
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants