Skip to content

Commit

Permalink
take valueerror test out of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Nov 10, 2018
1 parent dfca70a commit 8351f56
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mne_bids/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ def test_handle_kind():
n_channels = 1
sampling_rate = 100
data = random((n_channels, sampling_rate))
channel_types = ['grad', 'eeg', 'ecog', 'misc']
expected_kinds = ['meg', 'eeg', 'ieeg', 'error']
channel_types = ['grad', 'eeg', 'ecog']
expected_kinds = ['meg', 'eeg', 'ieeg']
# do it once for each type ... and once for "no type"
for chtype, kind in zip(channel_types, expected_kinds):
info = mne.create_info(n_channels, sampling_rate, ch_types=[chtype])
raw = mne.io.RawArray(data, info)
if kind != 'error':
assert _handle_kind(raw) == kind
continue
assert _handle_kind(raw) == kind

# if we cannot find a proper channel type, we raise an error
with pytest.raises(ValueError, match='Neither MEG/EEG/iEEG channels'):
_handle_kind(raw)
# if we cannot find a proper channel type, we raise an error
with pytest.raises(ValueError, match='Neither MEG/EEG/iEEG channels'):
info = mne.create_info(n_channels, sampling_rate, ch_types=['misc'])
raw = mne.io.RawArray(data, info)
_handle_kind(raw)


def test_print_dir_tree():
Expand Down

0 comments on commit 8351f56

Please sign in to comment.