Skip to content
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

Fixed unclosed test files to avoid ResourceWarning #10164

Merged
merged 1 commit into from Jul 10, 2018
Merged

Fixed unclosed test files to avoid ResourceWarning #10164

merged 1 commit into from Jul 10, 2018

Conversation

jdufresne
Copy link
Member

When Django tests with Python warnings enabled, fixes the warning of the form:

.../django/tests/file_storage/tests.py:598: ResourceWarning: unclosed file <_io.BufferedReader name='...'>
  self.assertEqual(self.storage.open(name).read(), content_1)
.../django/tests/file_storage/tests.py:603: ResourceWarning: unclosed file <_io.BufferedReader name='...'>
  self.assertEqual(self.storage.open(name).read(), content_2)

When Django tests with Python warnings enabled, fixes the warning of the
form:

.../django/tests/file_storage/tests.py:598: ResourceWarning: unclosed file <_io.BufferedReader name='...'>
  self.assertEqual(self.storage.open(name).read(), content_1)
.../django/tests/file_storage/tests.py:603: ResourceWarning: unclosed file <_io.BufferedReader name='...'>
  self.assertEqual(self.storage.open(name).read(), content_2)
Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good. Thanks.

@carltongibson carltongibson merged commit e7d7d47 into django:master Jul 10, 2018
@jdufresne jdufresne deleted the res-warning branch August 18, 2018 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants