Skip to content

TST: Fix io.ascii test warnings#7997

Closed
pllim wants to merge 2 commits intoastropy:masterfrom
pllim:fix-warn-io-ascii
Closed

TST: Fix io.ascii test warnings#7997
pllim wants to merge 2 commits intoastropy:masterfrom
pllim:fix-warn-io-ascii

Conversation

@pllim
Copy link
Member

@pllim pllim commented Oct 27, 2018

This PR gets rid of most of the warnings seen when removing addopts = -p no:warnings in setup.cfg and then running python setup.py test -P io.ascii --remote-data.

These still exist because I am not sure how to handle them:

astropy/io/ascii/tests/test_connect.py::test_read_latex_noformat
  .../astropy/io/ascii/connect.py:37: ResourceWarning: unclosed file <_io.TextIOWrapper name='.../astropy/io/ascii/tests/t/latex1.tex' encoding='UTF-8'>
    return read(filename, format=format, **kwargs)

astropy/io/ascii/tests/test_connect.py::test_read_rdb_noformat
  .../astropy/io/ascii/connect.py:37: ResourceWarning: unclosed file <_io.TextIOWrapper name='.../astropy/io/ascii/tests/t/short.rdb' encoding='UTF-8'>
    return read(filename, format=format, **kwargs)

astropy/io/ascii/tests/test_connect.py::test_read_csv
  .../astropy/io/ascii/connect.py:80: ResourceWarning: unclosed file <_io.TextIOWrapper name='.../astropy/io/ascii/tests/t/simple_csv.csv' encoding='UTF-8'>
    return read(filename, **kwargs)

astropy/io/ascii/tests/test_connect.py::test_auto_identify_ecsv
  .../astropy/io/ascii/connect.py:37: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pytest-of-lim/pytest-26/test_auto_identify_ecsv0/tmpFile.ecsv' encoding='UTF-8'>
    return read(filename, format=format, **kwargs)

astropy/io/ascii/tests/test_ecsv.py::test_round_trip_masked_table_default
  .../astropy/io/ascii/connect.py:37: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pytest-of-lim/pytest-26/test_round_trip_masked_table_d0/test.ecsv' encoding='UTF-8'>
    return read(filename, format=format, **kwargs)

astropy/io/ascii/tests/test_ecsv.py::test_round_trip_masked_table_serialize_mask
  .../astropy/io/ascii/connect.py:37: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pytest-of-lim/pytest-26/test_round_trip_masked_table_s0/test.ecsv' encoding='UTF-8'>
    return read(filename, format=format, **kwargs)

astropy/io/ascii/tests/test_read.py::test_from_filelike[True]
  .../astropy/io/ascii/tests/test_read.py:406: ResourceWarning: unclosed file <_io.TextIOWrapper name='t/simple.txt' encoding='UTF-8'>
    data = ascii.read(fd, fast_reader=fast_reader, **testfile['opts'])

astropy/io/ascii/tests/test_read.py::test_from_filelike[force]
  .../astropy/io/ascii/tests/test_read.py:406: ResourceWarning: unclosed file <_io.TextIOWrapper name='t/simple.txt' encoding='UTF-8'>
    data = ascii.read(fd, fast_reader=fast_reader, **testfile['opts'])

astropy/io/ascii/tests/test_read.py::test_guessing_file_object
  .../astropy/io/ascii/tests/test_read.py:992: ResourceWarning: unclosed file <_io.BufferedReader name='t/ipac.dat.bz2'>
    t = ascii.read(open('t/ipac.dat.bz2', 'rb'))

astropy/io/ascii/tests/test_read.py::test_read_chunks_input_types
  .../astropy/io/ascii/tests/test_read.py:1355: ResourceWarning: unclosed file <_io.TextIOWrapper name='t/test5.dat' mode='r' encoding='UTF-8'>
    for fp in (fpath, open(fpath, 'r'), open(fpath, 'r').read()):
  .../astropy/io/ascii/tests/test_read.py:1369: ResourceWarning: unclosed file <_io.TextIOWrapper name='t/test5.dat' mode='r' encoding='UTF-8'>
    for fp in (fpath, open(fpath, 'r'), open(fpath, 'r').read()):

Also see #7928

@astropy-bot
Copy link

astropy-bot bot commented Oct 27, 2018

Check results are now reported in the status checks at the bottom of this page.

@pllim pllim force-pushed the fix-warn-io-ascii branch from d8a06ad to 4db821a Compare October 27, 2018 16:22
@pllim pllim modified the milestones: v2.0.10, v2.0.11 Nov 11, 2018
@codecov
Copy link

codecov bot commented Nov 11, 2018

Codecov Report

Merging #7997 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7997   +/-   ##
=======================================
  Coverage   86.87%   86.87%           
=======================================
  Files         384      384           
  Lines       57860    57860           
  Branches     1078     1078           
=======================================
  Hits        50265    50265           
  Misses       6957     6957           
  Partials      638      638

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 1ca593a...4db821a. Read the comment docs.

@bsipocz bsipocz modified the milestones: v2.0.11, v2.0.12 Dec 31, 2018
@pllim
Copy link
Member Author

pllim commented Jan 15, 2019

There are conflicts now. Just gonna close this and revisit as new PR if I ever get time for it again.

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