Skip to content

Commit

Permalink
remove auto_inline test
Browse files Browse the repository at this point in the history
this test was previously never run because of
the odd behavior of pytest when filterwarnings
is provided an exception class (instead of a string).
This results in the exception class being decorated
with the mark, then the function being provided as the
first argument to the class (as the exception class
is used as the decorator). Because the exception class
does not start with "Test" the test is ignored during
collection.
  • Loading branch information
braingram committed Jul 31, 2023
1 parent a6036fe commit 56db403
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions asdf/_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,38 +345,6 @@ def test_extension_version_check(installed, extension, warns):
af._check_extensions(tree)


@pytest.mark.filterwarnings(AsdfDeprecationWarning)
def test_auto_inline(tmp_path):
outfile = str(tmp_path / "test.asdf")
tree = {"small_array": np.arange(6), "large_array": np.arange(100)}

# Use the same object for each write in order to make sure that there
# aren't unanticipated side effects
with asdf.AsdfFile(tree) as af:
# By default blocks are written internal.
af.write_to(outfile)
assert len(list(af._blocks.inline_blocks)) == 0
assert len(list(af._blocks.internal_blocks)) == 2

af.write_to(outfile, auto_inline=10)
assert len(list(af._blocks.inline_blocks)) == 1
assert len(list(af._blocks.internal_blocks)) == 1

# The previous write modified the small array block's storage
# to inline, and a subsequent write should maintain that setting.
af.write_to(outfile)
assert len(list(af._blocks.inline_blocks)) == 1
assert len(list(af._blocks.internal_blocks)) == 1

af.write_to(outfile, auto_inline=7)
assert len(list(af._blocks.inline_blocks)) == 1
assert len(list(af._blocks.internal_blocks)) == 1

af.write_to(outfile, auto_inline=5)
assert len(list(af._blocks.inline_blocks)) == 0
assert len(list(af._blocks.internal_blocks)) == 2


@pytest.mark.parametrize(
("array_inline_threshold", "inline_blocks", "internal_blocks"),
[
Expand Down

0 comments on commit 56db403

Please sign in to comment.