Skip to content

Commit

Permalink
Fix warnings (#270)
Browse files Browse the repository at this point in the history
* Use correct version of ndarray schema in unit tests

* Fix typo in asdf schema version in low-level unit test

* Update to reflect minor change in example schema in asdf-standard

* Close file FITS file handle in case of exception
  • Loading branch information
drdavella authored Jul 10, 2017
1 parent 81a353d commit 2e62213
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion asdf-standard
1 change: 1 addition & 0 deletions asdf/fits_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def open(cls, fd, uri=None, validate_checksums=False, extensions=None):
# responsible for cleaning up upon close() or __exit__
close_hdulist = True
except IOError:
file_obj.close()
msg = "Failed to parse given file '{}'. Is it FITS?"
raise ValueError(msg.format(file_obj.uri))

Expand Down
4 changes: 2 additions & 2 deletions asdf/tags/unit/tests/test_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_value_array(tmpdir):
testunit = units.kg
yaml = """
quantity: !unit/quantity-1.1.0
value: !core/ndarray-1.1.0 {}
value: !core/ndarray-1.0.0 {}
unit: {}
""".format(testval, testunit)

Expand All @@ -53,7 +53,7 @@ def test_value_multiarray(tmpdir):
testunit = units.ampere
yaml = """
quantity: !unit/quantity-1.1.0
value: !core/ndarray-1.1.0 {}
value: !core/ndarray-1.0.0 {}
unit: {}
""".format(testval, testunit)

Expand Down
2 changes: 1 addition & 1 deletion asdf/tests/test_low_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ def test_valid_version(tmpdir):
content = b"""#ASDF 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-0.1.0
--- !core/asdf-1.0.0
foo : bar
..."""
buff = io.BytesIO(content)
Expand Down

0 comments on commit 2e62213

Please sign in to comment.