Skip to content

Commit 7ea3f3b

Browse files
larsonerAdoNunes
authored andcommitted
MRG, MAINT: Fix PySurfer-related crash (mne-tools#7295)
* WIP: Try to fix crash * WIP: Second try * WIP: Remove PyVista * FIX: Try another method
1 parent 54796a2 commit 7ea3f3b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mne/viz/tests/test_3d.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# License: Simplified BSD
99

10+
import gc
1011
import os.path as op
1112
from pathlib import Path
1213

@@ -646,12 +647,20 @@ def test_plot_vector_source_estimates():
646647
data = np.random.RandomState(0).rand(n_verts, 3, n_time)
647648
stc = VectorSourceEstimate(data, vertices, 1, 1)
648649

649-
stc.plot('sample', subjects_dir=subjects_dir)
650+
brain = stc.plot('sample', subjects_dir=subjects_dir)
651+
brain.close()
652+
del brain
653+
gc.collect()
650654

651655
with pytest.raises(ValueError, match='use "pos_lims"'):
652656
stc.plot('sample', subjects_dir=subjects_dir,
653657
clim=dict(pos_lims=[1, 2, 3]))
654-
stc.plot('sample', subjects_dir=subjects_dir, hemi='both')
658+
gc.collect()
659+
660+
brain = stc.plot('sample', subjects_dir=subjects_dir, hemi='both')
661+
brain.close()
662+
del brain
663+
gc.collect()
655664

656665

657666
@testing.requires_testing_data

0 commit comments

Comments
 (0)