Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 24, 2023
1 parent ea33b83 commit 8c28a5b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions asdf/_tests/test_array_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,15 +802,16 @@ def test_unordered_block_index():

@pytest.fixture(scope="module")
def filename_with_array(tmp_path_factory):
fn = tmp_path_factory.mktemp('data') / 'filename_with_array.asdf'
fn = tmp_path_factory.mktemp("data") / "filename_with_array.asdf"
tree = {"array": np.random.random((20, 20))}
ff = asdf.AsdfFile(tree)
ff.write_to(fn)
return fn


@pytest.mark.parametrize(
"open_kwargs,should_memmap", [
"open_kwargs,should_memmap",
[
({}, True),
({"copy_arrays": True}, False),
({"copy_arrays": False}, True),
Expand All @@ -820,7 +821,8 @@ def filename_with_array(tmp_path_factory):
({"copy_arrays": False, "memmap_arrays": True}, True),
({"copy_arrays": True, "memmap_arrays": False}, False),
({"copy_arrays": False, "memmap_arrays": False}, False),
])
],
)
def test_open_no_memmap(filename_with_array, open_kwargs, should_memmap):
"""
Test that asdf.open does not (or does) return memmaps for arrays
Expand Down

0 comments on commit 8c28a5b

Please sign in to comment.