diff --git a/mne/preprocessing/tests/test_ssp.py b/mne/preprocessing/tests/test_ssp.py index 27de960ab6b..36bfa3505c1 100644 --- a/mne/preprocessing/tests/test_ssp.py +++ b/mne/preprocessing/tests/test_ssp.py @@ -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, diff --git a/mne/report/tests/test_report.py b/mne/report/tests/test_report.py index e8695253cbe..5f549093581 100644 --- a/mne/report/tests/test_report.py +++ b/mne/report/tests/test_report.py @@ -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( @@ -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" ) diff --git a/pyproject.toml b/pyproject.toml index 62cd1914318..58a5915cd2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 \