Skip to content

Avoid ResourceWarning with io.fits tests - #8439

Merged
pllim merged 1 commit into
astropy:masterfrom
saimn:fits-resource-warning
Feb 21, 2019
Merged

pllim merged 1 commit into
astropy:masterfrom
saimn:fits-resource-warning

Conversation

@saimn

@saimn saimn commented Feb 20, 2019

Copy link
Copy Markdown
Contributor

The warning that was printed at the end of pytest run:

sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name=6>

comes from test_write_hdulist_to_stream and is because of the use of a subprocess with a pipe that was not closed. See https://mail.python.org/pipermail/python-dev/2016-August/145830.html

Ref #7913 (can be closed ?)
Probably doesn't need to be backported ? Using Popen as a context manager seems to be possible since Python 3.2

The warning that was printed at the end of pytest run:

    sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name=6>

comes from `test_write_hdulist_to_stream` and is because of the use of
a subprocess with a pipe that was not closed. See
https://mail.python.org/pipermail/python-dev/2016-August/145830.html
@codecov

codecov Bot commented Feb 20, 2019

Copy link
Copy Markdown

Codecov Report

Merging #8439 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8439      +/-   ##
==========================================
- Coverage   86.78%   86.78%   -0.01%     
==========================================
  Files         387      387              
  Lines       58123    58123              
  Branches     1060     1060              
==========================================
- Hits        50441    50440       -1     
- Misses       7067     7068       +1     
  Partials      615      615
Impacted Files Coverage Δ
astropy/samp/hub.py 77.38% <0%> (-0.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35bd87d...31b1cf3. Read the comment docs.

@pllim pllim left a comment

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.

@pllim
pllim merged commit 747e033 into astropy:master Feb 21, 2019
@saimn
saimn deleted the fits-resource-warning branch February 21, 2019 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants