Skip to content

Commit 4df09b2

Browse files
Removing some code duplication.
1 parent d6a97e8 commit 4df09b2

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

pylossless/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def pipeline_fixture():
5656
@pytest.fixture(scope="session")
5757
@pytest.mark.filterwarnings("ignore:Converting data files to EDF format")
5858
def bids_dataset_fixture(tmpdir_factory):
59-
"""Make sure MNE's annotate_break function can run."""
59+
"""Returns a BIDS path for a test recording."""
6060
def edf_import_fct(path_in):
6161
# read in a file
6262
raw = mne.io.read_raw_edf(path_in, preload=True)

pylossless/tests/test_bids.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,6 @@
66

77

88
@pytest.mark.filterwarnings("ignore:Converting data files to EDF format")
9-
def test_convert_dataset_to_bids(tmp_path):
10-
"""Make sure MNE's annotate_break function can run."""
11-
def edf_import_fct(path_in):
12-
# read in a file
13-
raw = mne.io.read_raw_edf(path_in, preload=True)
14-
print(raw.annotations)
15-
return raw, np.array([[0, 0, 0]]), {"test": 0, "T0": 1, "T1": 2, "T2": 3}
16-
17-
testing_path = mne.datasets.testing.data_path()
18-
fname = testing_path / "EDF" / "test_edf_overlapping_annotations.edf"
19-
import_args = [{"path_in": fname}]
20-
bids_path_args = [{'subject': '001', 'run': '01', 'session': '01',
21-
"task": "test"}]
22-
ll.bids.convert_dataset_to_bids(
23-
edf_import_fct,
24-
import_args,
25-
bids_path_args,
26-
bids_root=tmp_path / "bids_dataset",
27-
overwrite=True
28-
)
29-
shutil.rmtree(tmp_path / "bids_dataset")
9+
def test_convert_dataset_to_bids(bids_dataset_fixture):
10+
"""Test the conversion of a recording to a BIDS dataset."""
11+
shutil.rmtree(bids_dataset_fixture.root)

0 commit comments

Comments
 (0)