Skip to content

Commit 6dbe739

Browse files
committed
TEST/DOC: Fix covariance test and tutorial
1 parent 5cf51d9 commit 6dbe739

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

mne/report/tests/test_report.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ def test_gif(tmp_path):
13611361
with pytest.raises(ValueError, match="Allowed values"):
13621362
r.add_image(bad_name, "fname")
13631363

1364-
def test_add_covariance_rank():
1364+
def test_add_covariance_rank(tmp_path):
13651365
from mne import create_info
13661366
from mne.cov import make_ad_hoc_cov
13671367
from mne.report import Report
@@ -1372,5 +1372,8 @@ def test_add_covariance_rank():
13721372
report = Report()
13731373
report.add_covariance(cov, info=info, title="Test Cov", rank=1)
13741374

1375-
html = "".join(report.html)
1375+
fname = tmp_path / "report.html"
1376+
report.save(fname, open_browser=False)
1377+
1378+
html = fname.read_text(encoding="utf-8")
13761379
assert "Rank" in html

tutorials/intro/70_report.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@
169169
rank = 60
170170

171171
report.add_covariance(
172-
cov,
173-
info=info,
174-
title="Noise covariance",
172+
cov=cov_path,
173+
info=raw_path,
174+
title="Covariance",
175175
rank=rank,
176176
)
177177
report.save("report_cov.html", overwrite=True)

0 commit comments

Comments
 (0)