def test_read_evoked(cur_system, version, use_info): """Test comparing reading an Evoked object and the FieldTrip version.""" test_data_folder_ft = get_data_paths(cur_system) mne_avg = get_evoked(cur_system) if use_info: info = get_raw_info(cur_system) pytestwarning = {'expected_warning': None} else: info = None pytestwarning = no_info_warning cur_fname = os.path.join(test_data_folder_ft, 'averaged_%s.mat' % (version,)) if version == 'v73' and not _has_h5py(): with pytest.raises(ImportError): mne.io.read_evoked_fieldtrip(cur_fname, info) return with pytest.warns(**pytestwarning): avg_ft = mne.io.read_evoked_fieldtrip(cur_fname, info) mne_data = mne_avg.data[:, :-1] ft_data = avg_ft.data check_data(mne_data, ft_data, cur_system) check_info_fields(mne_avg, avg_ft, use_info)
def test_read_evoked(cur_system, version, use_info): """Test comparing reading an Evoked object and the FieldTrip version.""" test_data_folder_ft = get_data_paths(cur_system) mne_avg = get_evoked(cur_system) if use_info: info = get_raw_info(cur_system) pytestwarning = {'expected_warning': None} else: info = None pytestwarning = no_info_warning cur_fname = os.path.join(test_data_folder_ft, 'averaged_%s.mat' % (version, )) if version == 'v73' and not _has_h5py(): with pytest.raises(ImportError): mne.io.read_evoked_fieldtrip(cur_fname, info) return with pytest.warns(**pytestwarning): avg_ft = mne.io.read_evoked_fieldtrip(cur_fname, info) mne_data = mne_avg.data[:, :-1] ft_data = avg_ft.data check_data(mne_data, ft_data, cur_system) check_info_fields(mne_avg, avg_ft, use_info)
def test_read_evoked(cur_system, version, use_info): """Test comparing reading an Evoked object and the FieldTrip version.""" test_data_folder_ft = get_data_paths(cur_system) mne_avg = get_evoked(cur_system) if use_info: info = get_raw_info(cur_system) ctx = nullcontext() else: info = None ctx = pytest.warns(**no_info_warning) cur_fname = os.path.join(test_data_folder_ft, 'averaged_%s.mat' % (version, )) with ctx: avg_ft = mne.io.read_evoked_fieldtrip(cur_fname, info) mne_data = mne_avg.data[:, :-1] ft_data = avg_ft.data check_data(mne_data, ft_data, cur_system) check_info_fields(mne_avg, avg_ft, use_info)