Coverage for nilearn/plotting/tests/test_img_plotting/test_plot_anat.py: 0%

11 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-16 12:32 +0200

1"""Tests for :func:`nilearn.plotting.plot_anat`.""" 

2 

3import matplotlib.pyplot as plt 

4import pytest 

5 

6from nilearn.plotting import plot_anat 

7 

8 

9def test_plot_anat_3d_img(img_3d_mni, tmp_path): 

10 """Smoke test for plot_anat.""" 

11 filename = tmp_path / "test.png" 

12 slicer = plot_anat(img_3d_mni, dim="auto") 

13 slicer.savefig(filename) 

14 plt.close() 

15 

16 

17def test_plot_img_invalid(): 

18 """Check that we get a meaningful error message \ 

19 when we give a wrong display_mode argument. 

20 """ 

21 with pytest.raises(ValueError): 

22 plot_anat(display_mode="zzz")