Skip to content

Commit

Permalink
FIX: More
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jan 24, 2024
1 parent ab8d724 commit 0a7b616
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mne/preprocessing/tests/test_ssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_compute_proj_parallel(short_raw):
filter_length=100,
)
raw_2 = short_raw.copy()
with pytest.warns(RuntimeWarning, match="Attenuation"):
with _record_warnings(), pytest.warns(RuntimeWarning, match="Attenuation"):
projs_2, _ = compute_proj_eog(
raw_2,
n_eeg=2,
Expand Down
6 changes: 4 additions & 2 deletions mne/report/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ def test_manual_report_2d(tmp_path, invisible_fig):
for ch in evoked_no_ch_locs.info["chs"]:
ch["loc"][:3] = np.nan

with pytest.warns(
with _record_warnings(), pytest.warns(
RuntimeWarning, match="No EEG channel locations found, cannot create joint plot"
):
r.add_evokeds(
Expand Down Expand Up @@ -1029,7 +1029,9 @@ def test_manual_report_2d(tmp_path, invisible_fig):
for ch in ica_no_ch_locs.info["chs"]:
ch["loc"][:3] = np.nan

with pytest.warns(RuntimeWarning, match="No Magnetometers channel locations"):
with _record_warnings(), pytest.warns(
RuntimeWarning, match="No Magnetometers channel locations"
):
r.add_ica(
ica=ica_no_ch_locs, picks=[0], inst=raw.copy().load_data(), title="ICA"
)
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ ignore-decorators = [
]

[tool.pytest.ini_options]
addopts = """--durations=20 --doctest-modules -ra --cov-report= --tb=short \
# -r f (failed), E (error), s (skipped), x (xfail), X (xpassed), w (warnings)
# don't put in xfail for pytest 8.0+ because then it prints the tracebacks,
# which look like real errors
addopts = """--durations=20 --doctest-modules -rfEXs --cov-report= --tb=short \
--cov-branch --doctest-ignore-import-errors --junit-xml=junit-results.xml \
--ignore=doc --ignore=logo --ignore=examples --ignore=tutorials \
--ignore=mne/gui/_*.py --ignore=mne/icons --ignore=tools \
Expand Down

0 comments on commit 0a7b616

Please sign in to comment.