Refactor test_plot_alignment_basic()#13472
Conversation
| def test_plot_alignment_cframe(renderer): | ||
| """Test varying the coordinate frame for alignment plot.""" | ||
| info = read_info(evoked_fname) | ||
| for coord_frame in ("meg", "head", "mri"): |
| info, | ||
| trans=trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, |
There was a problem hiding this comment.
pull out a shared_kwargs dict with these 4 params, to make clearer which params are different between each call to plot_alignment in this test
There was a problem hiding this comment.
I think this one is still pending
|
@larsoner @drammock Hey Eric, something I noticed while doing this refactor is that our volumetric source space example in our testing data set does not have a value for the subject field, i.e. |
|
We could, but it's also pretty easy to add a instead, which might be preferable anyway since it avoids some boilerplate. There are some similar things here already Line 783 in 7ed5e27 |
|
Code coverage is equal between main and this branch, so I think this is ready to go! |
| pytest.raises( | ||
| TypeError, | ||
| plot_alignment, | ||
| "foo", | ||
| trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, | ||
| ) |
There was a problem hiding this comment.
Let's modernize with context manager
with pytest.raises(..., match="...):
call(...)
| info, | ||
| trans=trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, |
There was a problem hiding this comment.
I think this one is still pending
What does this implement/fix?
This is a PR to simplify an overly long and complicated test in the testing suite for #D visualization. This refactor breaks testing of the function
mne.viz.plot_alignmentinto manageable chunks, separating tests of different parameters, and separating error checking from test plots (except where doing so would add extra up front instantiations).