MCPcopy
hub / github.com/mne-tools/mne-python / test_verbose_method

Function test_verbose_method

mne/utils/tests/test_logging.py:162–185  ·  view source on GitHub ↗

Test for gh-8772.

(verbose)

Source from the content-addressed store, hash-verified

160
161@pytest.mark.parametrize("verbose", (True, False))
162def test_verbose_method(verbose):
163 """Test for gh-8772."""
164 # raw
165 raw = read_raw_fif(fname_raw, verbose=verbose)
166 with catch_logging() as log:
167 raw.load_data(verbose=True)
168 log = log.getvalue()
169 assert "Reading 0 ... 14399" in log
170 with catch_logging() as log:
171 raw.load_data(verbose=False)
172 log = log.getvalue()
173 assert log == ""
174 # epochs
175 events = np.array([[raw.first_samp + 200, 0, 1]], int)
176 epochs = Epochs(raw, events, verbose=verbose)
177 with catch_logging() as log:
178 epochs.drop_bad(verbose=True)
179 log = log.getvalue()
180 assert "0 bad epochs dropped" in log
181 epochs = Epochs(raw, events, verbose=verbose)
182 with catch_logging() as log:
183 epochs.drop_bad(verbose=False)
184 log = log.getvalue()
185 assert log == ""
186
187
188def test_warn(capsys, tmp_path, monkeypatch):

Callers

nothing calls this directly

Calls 6

read_raw_fifFunction · 0.90
catch_loggingClass · 0.90
EpochsClass · 0.90
getvalueMethod · 0.80
drop_badMethod · 0.80
load_dataMethod · 0.45

Tested by

no test coverage detected