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

test: Use context managers to avoid <_io.FileIO [closed]> warnings #1784

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Feb 19, 2022

Description

Resolves #1776

  • Use context managers to avoid warnings from files not being closed properly.
  • Remove filterwarnings for 'pytest.PytestUnraisableExceptionWarning:Exception ignored in: <_io.FileIO [closed]>' warnings
  • Rename context manager variables from PR fix: Specify encoding as utf-8 to enforce PEP 597 #2007 to be more informative

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Use context managers to avoid warnings from files not being closed properly.
* Remove filterwarnings for 'pytest.PytestUnraisableExceptionWarning:Exception
ignored in: <_io.FileIO [closed]>' warnings.
* Use context managers in docs and notebooks to promote best practices.
* Rename context manager variables from PR #2007 to be more informative.
   - Amends PR #2007

@matthewfeickert matthewfeickert added docs Documentation related tests pytest labels Feb 19, 2022
@matthewfeickert matthewfeickert self-assigned this Feb 19, 2022
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@matthewfeickert matthewfeickert added the chore Other changes that don't modify src or test files label Feb 19, 2022
@matthewfeickert matthewfeickert marked this pull request as draft February 19, 2022 07:49
@matthewfeickert matthewfeickert force-pushed the test/use-context-manager branch 2 times, most recently from 8b3f952 to bcebcc0 Compare September 15, 2022 04:30
@matthewfeickert
Copy link
Member Author

Additional context managers still needed in tests/test_scripts.py.

@matthewfeickert matthewfeickert added this to In progress in v0.7.1 via automation Sep 15, 2022
@matthewfeickert matthewfeickert changed the base branch from master to main September 21, 2022 20:52
@matthewfeickert matthewfeickert removed this from In progress in v0.7.1 Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Other changes that don't modify src or test files docs Documentation related tests pytest
Projects
Status: Todo
1 participant