Skip to content

Commit

Permalink
Merge pull request #1532 from braingram/astropy_asdf_drop
Browse files Browse the repository at this point in the history
drop depending on astropy.io.misc.asdf for test
  • Loading branch information
braingram authored May 3, 2023
2 parents 353d213 + 152af9d commit 0e3b3e4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions asdf/_tests/tags/core/tests/test_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,18 @@ def test_array_inline_threshold_recursive(tmpdir):
aff = models.AffineTransformation2D(matrix=[[1, 2], [3, 4]])
tree = {"test": aff}

def check_asdf(asdf):
assert len(list(asdf._blocks.internal_blocks)) == 0

with asdf.config_context() as config:
config.array_inline_threshold = 100
helpers.assert_roundtrip_tree(tree, tmpdir, asdf_check_func=check_asdf)
# we can no longer use _helpers.assert_roundtrip_tree here because
# the model no longer has a CustomType which results in equality testing
# using == which will fail
# this test appears to be designed to test the inline threshold so we can
# just look at the number of blocks
fn = str(tmpdir / "test.asdf")
af = asdf.AsdfFile(tree)
af.write_to(fn)
with asdf.open(fn) as af:
assert len(list(af._blocks.internal_blocks)) == 0


def test_copy_inline():
Expand Down

0 comments on commit 0e3b3e4

Please sign in to comment.