Skip to content

Commit

Permalink
FIX: First
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Apr 2, 2024
1 parent d696f08 commit 609e48d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mne_nirs/io/snirf/tests/test_snirf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

pytest.importorskip("h5py")

MNE_1_7 = check_version("mne", "1.7")


@requires_testing_data
@pytest.mark.parametrize(
Expand All @@ -50,7 +52,7 @@ def test_snirf_write_raw(fname, tmpdir):
raw = read_raw_snirf(test_file, preload=True)
# Correct MNE bug with reading
subj_info = raw.info["subject_info"]
if not check_version("mne", "1.7"):
if not MNE_1_7:
assert "_" in subj_info["first_name"]
subj_info["first_name"] = subj_info["first_name"].split("_")[0]
assert "his_id" not in subj_info
Expand Down Expand Up @@ -100,7 +102,10 @@ def test_snirf_write_raw(fname, tmpdir):
del raw.info["subject_info"]["his_id"]
write_raw_snirf(raw, test_file)
raw = read_raw_snirf(test_file)
assert raw.info["subject_info"]["his_id"] == his_id
if MNE_1_7:
assert raw.info["subject_info"]["his_id"] == his_id
else:
assert raw.info["subject_info"]["first_name"] == his_id


@requires_testing_data
Expand Down

0 comments on commit 609e48d

Please sign in to comment.