

@testing.requires_testing_data
def test_make_inverse_operator_bads():
    'Test MNE inverse computation given a mismatch of bad channels\n    '
    fwd_op = read_forward_solution_meg(fname_fwd, surf_ori=True)
    evoked = _get_evoked()
    noise_cov = read_cov(fname_cov)
    bad = evoked.info['bads'].pop()
    inv_ = make_inverse_operator(evoked.info, fwd_op, noise_cov, loose=None)
    union_good = (set(noise_cov['names']) & set(evoked.ch_names))
    union_bads = (set(noise_cov['bads']) & set(evoked.info['bads']))
    evoked.info['bads'].append(bad)
    assert_true((len((set(inv_['info']['ch_names']) - union_good)) == 0))
    assert_true((len((set(inv_['info']['bads']) - union_bads)) == 0))

dataset/ETHPy150Open mne-tools/mne-python/mne/minimum_norm/tests/test_inverse.py test_make_inverse_operator_bads/original