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

Use context manager where possible #2758

Merged

Conversation

mulkieran
Copy link
Member

@mulkieran
Copy link
Member Author

Where other instances are identified by pylint where we can not use a context manager should clean up file handles better, see characteristic failure when unique_instance test or test_duplicate_pool_name in udev tests fails.

test_duplicate_pool_name (tests.udev.test_udev.UdevTest5) ... ERROR
/usr/lib64/python3.7/subprocess.py:883: ResourceWarning: subprocess 11378 is still running
  ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib64/python3.7/unittest/case.py:656: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='UTF-8'>
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib64/python3.7/unittest/case.py:656: ResourceWarning: unclosed file <_io.TextIOWrapper name=6 encoding='UTF-8'>
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback

@mulkieran mulkieran marked this pull request as ready for review August 27, 2021 15:46
Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran
Copy link
Member Author

rebased.

@mulkieran mulkieran merged commit 0ab8c96 into stratis-storage:develop-2.4.2 Aug 27, 2021
@mulkieran mulkieran deleted the project-issue-342 branch August 27, 2021 16: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
Development

Successfully merging this pull request may close these issues.

1 participant