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 Aug 14, 2023
1 parent cd3fe4d commit 96f932c
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions mne/tests/test_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,17 +1553,24 @@ def test_split_saving(tmp_path, epochs_to_split, preload):
assert_array_equal(epochs.events, epochs2.events)


@pytest.mark.parametrize("split_naming, split_fname, split_fname_part1", [
("neuromag", "test_epo.fif", lambda n: f"test_epo-{n + 1}.fif"),
("bids", "test_epo.fif", lambda n: f"test_split-{n + 1:02d}_epo.fif"),
])
def test_split_naming(tmp_path, epochs_to_split, split_naming, split_fname, split_fname_part1):
@pytest.mark.parametrize(
"split_naming, split_fname, split_fname_part1",
[
("neuromag", "test_epo.fif", lambda n: f"test_epo-{n + 1}.fif"),
("bids", "test_epo.fif", lambda n: f"test_split-{n + 1:02d}_epo.fif"),
],
)
def test_split_naming(
tmp_path, epochs_to_split, split_naming, split_fname, split_fname_part1
):
"""Test naming of the split files."""
epochs, _, n_files = epochs_to_split
split_fpath = tmp_path / split_fname
# we don't test for reserved files as it's not implemented here

epochs.save(split_fpath, split_size="1.4MB", split_naming=split_naming, verbose=True)
epochs.save(
split_fpath, split_size="1.4MB", split_naming=split_naming, verbose=True
)

# check that the filenames match the intended pattern
assert split_fpath.is_file()
Expand All @@ -1586,7 +1593,7 @@ def test_saved_fname_no_splitting(tmp_path, epochs_to_split):

@pytest.mark.parametrize("split_naming", ["neuromag", "bids"])
def test_saving_fails_with_not_permitted_overwrite(
tmp_path, epochs_factory, split_naming
tmp_path, epochs_factory, split_naming
):
"""Check exception is raised when overwriting without explicit flag."""
dst_fpath = tmp_path / "test-epo.fif"
Expand Down

0 comments on commit 96f932c

Please sign in to comment.