We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Why do we have matplotlib < 3.1 in requirements.txt?
@massich can you try if 3.1 works? It would be nice to support the current matplotlib version.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mne/conftest.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Author: Eric Larson <larson.eric.d@gmail.com>
3 #
4 # License: BSD (3-clause)
5 
6 import os.path as op
7 import warnings
8 import pytest
9 # For some unknown reason, on Travis-xenial there are segfaults caused on
10 # the line pytest -> pdb.Pdb.__init__ -> "import readline". Forcing an
11 # import here seems to prevent them (!?). This suggests a potential problem
12 # with some other library stepping on memory where it shouldn't. It only
13 # seems to happen on the Linux runs that install Mayavi. Anectodally,
14 # @larsoner has had problems a couple of years ago where a mayavi import
15 # seemed to corrupt SciPy linalg function results (!), likely due to the
16 # associated VTK import, so this could be another manifestation of that.
17 try:
18     import readline  # noqa
19 except Exception:
20     pass
21 
22 import numpy as np
23 import mne
24 from mne.datasets import testing
25 from mne.fixes import _get_args
26 
27 test_path = testing.data_path(download=False)
28 s_path = op.join(test_path, 'MEG', 'sample')
29 fname_evoked = op.join(s_path, 'sample_audvis_trunc-ave.fif')
30 fname_cov = op.join(s_path, 'sample_audvis_trunc-cov.fif')
31 fname_fwd = op.join(s_path, 'sample_audvis_trunc-meg-eeg-oct-4-fwd.fif')
32 
33 
34 def pytest_configure(config):
35     """Configure pytest options."""
36     # Markers
37     for marker in ('slowtest', 'ultraslowtest'):
38         config.addinivalue_line('markers', marker)
39 
40     # Fixtures
41     for fixture in ('matplotlib_config',):
42         config.addinivalue_line('usefixtures', fixture)
43 
44     # Warnings
45     # - Once SciPy updates not to have non-integer and non-tuple errors (1.2.0)
46     #   we should remove them from here.
47     # - This list should also be considered alongside reset_warnings in
48     #   doc/conf.py.
49     warning_lines = """
50     error::
51     ignore::ImportWarning
52     ignore:the matrix subclass:PendingDeprecationWarning
53     ignore:numpy.dtype size changed:RuntimeWarning
54     ignore:.*HasTraits.trait_.*:DeprecationWarning
55     ignore:.*takes no parameters:DeprecationWarning
56     ignore:joblib not installed:RuntimeWarning
57     ignore:Using a non-tuple sequence for multidimensional indexing:FutureWarning
58     ignore:using a non-integer number instead of an integer will result in an error:DeprecationWarning
59     ignore:Importing from numpy.testing.decorators is deprecated:DeprecationWarning
60     ignore:np.loads is deprecated, use pickle.loads instead:DeprecationWarning
61     ignore:The oldnumeric module will be dropped:DeprecationWarning
62     ignore:Collection picker None could not be converted to float:UserWarning
63     ignore:covariance is not positive-semidefinite:RuntimeWarning
64     ignore:Can only plot ICA components:RuntimeWarning
65     ignore:Matplotlib is building the font cache using fc-list:UserWarning
66     ignore:Using or importing the ABCs from 'collections':DeprecationWarning
67     ignore:`formatargspec` is deprecated:DeprecationWarning
68     # This is only necessary until sklearn updates their wheels for NumPy 1.16
69     ignore:numpy.ufunc size changed:RuntimeWarning
70     ignore:.*mne-realtime.*:DeprecationWarning
71     """  # noqa: E501
72     for warning_line in warning_lines.split('\n'):
73         warning_line = warning_line.strip()
74         if warning_line and not warning_line.startswith('#'):
75             config.addinivalue_line('filterwarnings', warning_line)
76 
77 
78 @pytest.fixture(scope='session')
79 def matplotlib_config():
80     """Configure matplotlib for viz tests."""
81     import matplotlib
82     # "force" should not really be necessary but should not hurt
83     kwargs = dict()
84     if 'warn' in _get_args(matplotlib.use):
85         kwargs['warn'] = False
86     matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows
87     import matplotlib.pyplot as plt
88     assert plt.get_backend() == 'agg'
89     # overwrite some params that can horribly slow down tests that
90     # users might have changed locally (but should not otherwise affect
91     # functionality)
92     plt.ioff()
93     plt.rcParams['figure.dpi'] = 100
94     try:
95         from traits.etsconfig.api import ETSConfig
96     except Exception:
97         pass
98     else:
99         ETSConfig.toolkit = 'qt4'
100     try:
101         with warnings.catch_warnings(record=True):  # traits
102             from mayavi import mlab
103     except Exception:
104         pass
105     else:
106         mlab.options.backend = 'test'
107 
108 
109 @pytest.fixture(scope='function', params=[testing._pytest_param()])
110 def evoked():
111     """Get evoked data."""
112     evoked = mne.read_evokeds(fname_evoked, condition='Left Auditory',
113                               baseline=(None, 0))
114     evoked.crop(0, 0.2)
115     return evoked
116 
117 
118 @pytest.fixture(scope='function', params=[testing._pytest_param()])
119 def noise_cov():
120     """Get a noise cov from the testing dataset."""
121     return mne.read_cov(fname_cov)
122 
123 
124 @pytest.fixture(scope='function')
125 def bias_params_free(evoked, noise_cov):
126     """Provide inputs for free bias functions."""
127     fwd = mne.read_forward_solution(fname_fwd)
128     return _bias_params(evoked, noise_cov, fwd)
129 
130 
131 @pytest.fixture(scope='function')
132 def bias_params_fixed(evoked, noise_cov):
133     """Provide inputs for fixed bias functions."""
134     fwd = mne.read_forward_solution(fname_fwd)
135     fwd = mne.convert_forward_solution(fwd, force_fixed=True, surf_ori=True)
136     return _bias_params(evoked, noise_cov, fwd)
137 
138 
139 def _bias_params(evoked, noise_cov, fwd):
140     evoked.pick_types(meg=True, eeg=True, exclude=())
141     # restrict to limited set of verts (small src here) and one hemi for speed
142     vertices = [fwd['src'][0]['vertno'].copy(), []]
143     stc = mne.SourceEstimate(np.zeros((sum(len(v) for v in vertices), 1)),
144                              vertices, 0., 1.)
145     fwd = mne.forward.restrict_forward_to_stc(fwd, stc)
146     assert fwd['sol']['row_names'] == noise_cov['names']
147     assert noise_cov['names'] == evoked.ch_names
148     evoked = mne.EvokedArray(fwd['sol']['data'].copy(), evoked.info)
149     data_cov = noise_cov.copy()
150     data_cov['data'] = np.dot(fwd['sol']['data'], fwd['sol']['data'].T)
151     assert data_cov['data'].shape[0] == len(noise_cov['names'])
152     want = np.arange(fwd['sol']['data'].shape[1])
153     if not mne.forward.is_fixed_orient(fwd):
154         want //= 3
155     return evoked, fwd, noise_cov, data_cov, want
156 
157 
158 @pytest.fixture(scope="module", params=[
159     "mayavi",
160     "pyvista",
161 ])
162 def backend_name(request):
163     """Get the backend name."""
164     yield request.param
165 
166 
167 @pytest.yield_fixture
168 def renderer(backend_name):
169     """Yield the 3D backends."""
170     from mne.viz.backends.renderer import _use_test_3d_backend
171     from mne.viz.backends.tests._utils import has_mayavi, has_pyvista
172     if backend_name == 'mayavi':
173         if not has_mayavi():
174             pytest.skip("Test skipped, requires mayavi.")
175     elif backend_name == 'pyvista':
176         if not has_pyvista():
177             pytest.skip("Test skipped, requires pyvista.")
178     with _use_test_3d_backend(backend_name):
179         from mne.viz.backends import renderer
180         yield renderer
181         renderer._close_all()
182
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mne/conftest.py b/mne/conftest.py
--- a/mne/conftest.py
+++ b/mne/conftest.py
@@ -22,7 +22,6 @@
 import numpy as np
 import mne
 from mne.datasets import testing
-from mne.fixes import _get_args
 
 test_path = testing.data_path(download=False)
 s_path = op.join(test_path, 'MEG', 'sample')
@@ -81,9 +80,8 @@
     import matplotlib
     # "force" should not really be necessary but should not hurt
     kwargs = dict()
-    if 'warn' in _get_args(matplotlib.use):
-        kwargs['warn'] = False
-    matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows
+    with warnings.catch_warnings(record=True):  # ignore warning
+        matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows
     import matplotlib.pyplot as plt
     assert plt.get_backend() == 'agg'
     # overwrite some params that can horribly slow down tests that

{"golden_diff": "diff --git a/mne/conftest.py b/mne/conftest.py\n--- a/mne/conftest.py\n+++ b/mne/conftest.py\n@@ -22,7 +22,6 @@\n import numpy as np\n import mne\n from mne.datasets import testing\n-from mne.fixes import _get_args\n \n test_path = testing.data_path(download=False)\n s_path = op.join(test_path, 'MEG', 'sample')\n@@ -81,9 +80,8 @@\n     import matplotlib\n     # \"force\" should not really be necessary but should not hurt\n     kwargs = dict()\n-    if 'warn' in _get_args(matplotlib.use):\n-        kwargs['warn'] = False\n-    matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows\n+    with warnings.catch_warnings(record=True):  # ignore warning\n+        matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows\n     import matplotlib.pyplot as plt\n     assert plt.get_backend() == 'agg'\n     # overwrite some params that can horribly slow down tests that\n", "issue": "Why do we have matplotlib < 3.1 in requirements.txt?\n@massich can you try if 3.1 works? It would be nice to support the current matplotlib version.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Author: Eric Larson <larson.eric.d@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport os.path as op\nimport warnings\nimport pytest\n# For some unknown reason, on Travis-xenial there are segfaults caused on\n# the line pytest -> pdb.Pdb.__init__ -> \"import readline\". Forcing an\n# import here seems to prevent them (!?). This suggests a potential problem\n# with some other library stepping on memory where it shouldn't. It only\n# seems to happen on the Linux runs that install Mayavi. Anectodally,\n# @larsoner has had problems a couple of years ago where a mayavi import\n# seemed to corrupt SciPy linalg function results (!), likely due to the\n# associated VTK import, so this could be another manifestation of that.\ntry:\n    import readline  # noqa\nexcept Exception:\n    pass\n\nimport numpy as np\nimport mne\nfrom mne.datasets import testing\nfrom mne.fixes import _get_args\n\ntest_path = testing.data_path(download=False)\ns_path = op.join(test_path, 'MEG', 'sample')\nfname_evoked = op.join(s_path, 'sample_audvis_trunc-ave.fif')\nfname_cov = op.join(s_path, 'sample_audvis_trunc-cov.fif')\nfname_fwd = op.join(s_path, 'sample_audvis_trunc-meg-eeg-oct-4-fwd.fif')\n\n\ndef pytest_configure(config):\n    \"\"\"Configure pytest options.\"\"\"\n    # Markers\n    for marker in ('slowtest', 'ultraslowtest'):\n        config.addinivalue_line('markers', marker)\n\n    # Fixtures\n    for fixture in ('matplotlib_config',):\n        config.addinivalue_line('usefixtures', fixture)\n\n    # Warnings\n    # - Once SciPy updates not to have non-integer and non-tuple errors (1.2.0)\n    #   we should remove them from here.\n    # - This list should also be considered alongside reset_warnings in\n    #   doc/conf.py.\n    warning_lines = \"\"\"\n    error::\n    ignore::ImportWarning\n    ignore:the matrix subclass:PendingDeprecationWarning\n    ignore:numpy.dtype size changed:RuntimeWarning\n    ignore:.*HasTraits.trait_.*:DeprecationWarning\n    ignore:.*takes no parameters:DeprecationWarning\n    ignore:joblib not installed:RuntimeWarning\n    ignore:Using a non-tuple sequence for multidimensional indexing:FutureWarning\n    ignore:using a non-integer number instead of an integer will result in an error:DeprecationWarning\n    ignore:Importing from numpy.testing.decorators is deprecated:DeprecationWarning\n    ignore:np.loads is deprecated, use pickle.loads instead:DeprecationWarning\n    ignore:The oldnumeric module will be dropped:DeprecationWarning\n    ignore:Collection picker None could not be converted to float:UserWarning\n    ignore:covariance is not positive-semidefinite:RuntimeWarning\n    ignore:Can only plot ICA components:RuntimeWarning\n    ignore:Matplotlib is building the font cache using fc-list:UserWarning\n    ignore:Using or importing the ABCs from 'collections':DeprecationWarning\n    ignore:`formatargspec` is deprecated:DeprecationWarning\n    # This is only necessary until sklearn updates their wheels for NumPy 1.16\n    ignore:numpy.ufunc size changed:RuntimeWarning\n    ignore:.*mne-realtime.*:DeprecationWarning\n    \"\"\"  # noqa: E501\n    for warning_line in warning_lines.split('\\n'):\n        warning_line = warning_line.strip()\n        if warning_line and not warning_line.startswith('#'):\n            config.addinivalue_line('filterwarnings', warning_line)\n\n\n@pytest.fixture(scope='session')\ndef matplotlib_config():\n    \"\"\"Configure matplotlib for viz tests.\"\"\"\n    import matplotlib\n    # \"force\" should not really be necessary but should not hurt\n    kwargs = dict()\n    if 'warn' in _get_args(matplotlib.use):\n        kwargs['warn'] = False\n    matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows\n    import matplotlib.pyplot as plt\n    assert plt.get_backend() == 'agg'\n    # overwrite some params that can horribly slow down tests that\n    # users might have changed locally (but should not otherwise affect\n    # functionality)\n    plt.ioff()\n    plt.rcParams['figure.dpi'] = 100\n    try:\n        from traits.etsconfig.api import ETSConfig\n    except Exception:\n        pass\n    else:\n        ETSConfig.toolkit = 'qt4'\n    try:\n        with warnings.catch_warnings(record=True):  # traits\n            from mayavi import mlab\n    except Exception:\n        pass\n    else:\n        mlab.options.backend = 'test'\n\n\n@pytest.fixture(scope='function', params=[testing._pytest_param()])\ndef evoked():\n    \"\"\"Get evoked data.\"\"\"\n    evoked = mne.read_evokeds(fname_evoked, condition='Left Auditory',\n                              baseline=(None, 0))\n    evoked.crop(0, 0.2)\n    return evoked\n\n\n@pytest.fixture(scope='function', params=[testing._pytest_param()])\ndef noise_cov():\n    \"\"\"Get a noise cov from the testing dataset.\"\"\"\n    return mne.read_cov(fname_cov)\n\n\n@pytest.fixture(scope='function')\ndef bias_params_free(evoked, noise_cov):\n    \"\"\"Provide inputs for free bias functions.\"\"\"\n    fwd = mne.read_forward_solution(fname_fwd)\n    return _bias_params(evoked, noise_cov, fwd)\n\n\n@pytest.fixture(scope='function')\ndef bias_params_fixed(evoked, noise_cov):\n    \"\"\"Provide inputs for fixed bias functions.\"\"\"\n    fwd = mne.read_forward_solution(fname_fwd)\n    fwd = mne.convert_forward_solution(fwd, force_fixed=True, surf_ori=True)\n    return _bias_params(evoked, noise_cov, fwd)\n\n\ndef _bias_params(evoked, noise_cov, fwd):\n    evoked.pick_types(meg=True, eeg=True, exclude=())\n    # restrict to limited set of verts (small src here) and one hemi for speed\n    vertices = [fwd['src'][0]['vertno'].copy(), []]\n    stc = mne.SourceEstimate(np.zeros((sum(len(v) for v in vertices), 1)),\n                             vertices, 0., 1.)\n    fwd = mne.forward.restrict_forward_to_stc(fwd, stc)\n    assert fwd['sol']['row_names'] == noise_cov['names']\n    assert noise_cov['names'] == evoked.ch_names\n    evoked = mne.EvokedArray(fwd['sol']['data'].copy(), evoked.info)\n    data_cov = noise_cov.copy()\n    data_cov['data'] = np.dot(fwd['sol']['data'], fwd['sol']['data'].T)\n    assert data_cov['data'].shape[0] == len(noise_cov['names'])\n    want = np.arange(fwd['sol']['data'].shape[1])\n    if not mne.forward.is_fixed_orient(fwd):\n        want //= 3\n    return evoked, fwd, noise_cov, data_cov, want\n\n\n@pytest.fixture(scope=\"module\", params=[\n    \"mayavi\",\n    \"pyvista\",\n])\ndef backend_name(request):\n    \"\"\"Get the backend name.\"\"\"\n    yield request.param\n\n\n@pytest.yield_fixture\ndef renderer(backend_name):\n    \"\"\"Yield the 3D backends.\"\"\"\n    from mne.viz.backends.renderer import _use_test_3d_backend\n    from mne.viz.backends.tests._utils import has_mayavi, has_pyvista\n    if backend_name == 'mayavi':\n        if not has_mayavi():\n            pytest.skip(\"Test skipped, requires mayavi.\")\n    elif backend_name == 'pyvista':\n        if not has_pyvista():\n            pytest.skip(\"Test skipped, requires pyvista.\")\n    with _use_test_3d_backend(backend_name):\n        from mne.viz.backends import renderer\n        yield renderer\n        renderer._close_all()\n", "path": "mne/conftest.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Author: Eric Larson <larson.eric.d@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport os.path as op\nimport warnings\nimport pytest\n# For some unknown reason, on Travis-xenial there are segfaults caused on\n# the line pytest -> pdb.Pdb.__init__ -> \"import readline\". Forcing an\n# import here seems to prevent them (!?). This suggests a potential problem\n# with some other library stepping on memory where it shouldn't. It only\n# seems to happen on the Linux runs that install Mayavi. Anectodally,\n# @larsoner has had problems a couple of years ago where a mayavi import\n# seemed to corrupt SciPy linalg function results (!), likely due to the\n# associated VTK import, so this could be another manifestation of that.\ntry:\n    import readline  # noqa\nexcept Exception:\n    pass\n\nimport numpy as np\nimport mne\nfrom mne.datasets import testing\n\ntest_path = testing.data_path(download=False)\ns_path = op.join(test_path, 'MEG', 'sample')\nfname_evoked = op.join(s_path, 'sample_audvis_trunc-ave.fif')\nfname_cov = op.join(s_path, 'sample_audvis_trunc-cov.fif')\nfname_fwd = op.join(s_path, 'sample_audvis_trunc-meg-eeg-oct-4-fwd.fif')\n\n\ndef pytest_configure(config):\n    \"\"\"Configure pytest options.\"\"\"\n    # Markers\n    for marker in ('slowtest', 'ultraslowtest'):\n        config.addinivalue_line('markers', marker)\n\n    # Fixtures\n    for fixture in ('matplotlib_config',):\n        config.addinivalue_line('usefixtures', fixture)\n\n    # Warnings\n    # - Once SciPy updates not to have non-integer and non-tuple errors (1.2.0)\n    #   we should remove them from here.\n    # - This list should also be considered alongside reset_warnings in\n    #   doc/conf.py.\n    warning_lines = \"\"\"\n    error::\n    ignore::ImportWarning\n    ignore:the matrix subclass:PendingDeprecationWarning\n    ignore:numpy.dtype size changed:RuntimeWarning\n    ignore:.*HasTraits.trait_.*:DeprecationWarning\n    ignore:.*takes no parameters:DeprecationWarning\n    ignore:joblib not installed:RuntimeWarning\n    ignore:Using a non-tuple sequence for multidimensional indexing:FutureWarning\n    ignore:using a non-integer number instead of an integer will result in an error:DeprecationWarning\n    ignore:Importing from numpy.testing.decorators is deprecated:DeprecationWarning\n    ignore:np.loads is deprecated, use pickle.loads instead:DeprecationWarning\n    ignore:The oldnumeric module will be dropped:DeprecationWarning\n    ignore:Collection picker None could not be converted to float:UserWarning\n    ignore:covariance is not positive-semidefinite:RuntimeWarning\n    ignore:Can only plot ICA components:RuntimeWarning\n    ignore:Matplotlib is building the font cache using fc-list:UserWarning\n    ignore:Using or importing the ABCs from 'collections':DeprecationWarning\n    ignore:`formatargspec` is deprecated:DeprecationWarning\n    # This is only necessary until sklearn updates their wheels for NumPy 1.16\n    ignore:numpy.ufunc size changed:RuntimeWarning\n    ignore:.*mne-realtime.*:DeprecationWarning\n    \"\"\"  # noqa: E501\n    for warning_line in warning_lines.split('\\n'):\n        warning_line = warning_line.strip()\n        if warning_line and not warning_line.startswith('#'):\n            config.addinivalue_line('filterwarnings', warning_line)\n\n\n@pytest.fixture(scope='session')\ndef matplotlib_config():\n    \"\"\"Configure matplotlib for viz tests.\"\"\"\n    import matplotlib\n    # \"force\" should not really be necessary but should not hurt\n    kwargs = dict()\n    with warnings.catch_warnings(record=True):  # ignore warning\n        matplotlib.use('agg', force=True, **kwargs)  # don't pop up windows\n    import matplotlib.pyplot as plt\n    assert plt.get_backend() == 'agg'\n    # overwrite some params that can horribly slow down tests that\n    # users might have changed locally (but should not otherwise affect\n    # functionality)\n    plt.ioff()\n    plt.rcParams['figure.dpi'] = 100\n    try:\n        from traits.etsconfig.api import ETSConfig\n    except Exception:\n        pass\n    else:\n        ETSConfig.toolkit = 'qt4'\n    try:\n        with warnings.catch_warnings(record=True):  # traits\n            from mayavi import mlab\n    except Exception:\n        pass\n    else:\n        mlab.options.backend = 'test'\n\n\n@pytest.fixture(scope='function', params=[testing._pytest_param()])\ndef evoked():\n    \"\"\"Get evoked data.\"\"\"\n    evoked = mne.read_evokeds(fname_evoked, condition='Left Auditory',\n                              baseline=(None, 0))\n    evoked.crop(0, 0.2)\n    return evoked\n\n\n@pytest.fixture(scope='function', params=[testing._pytest_param()])\ndef noise_cov():\n    \"\"\"Get a noise cov from the testing dataset.\"\"\"\n    return mne.read_cov(fname_cov)\n\n\n@pytest.fixture(scope='function')\ndef bias_params_free(evoked, noise_cov):\n    \"\"\"Provide inputs for free bias functions.\"\"\"\n    fwd = mne.read_forward_solution(fname_fwd)\n    return _bias_params(evoked, noise_cov, fwd)\n\n\n@pytest.fixture(scope='function')\ndef bias_params_fixed(evoked, noise_cov):\n    \"\"\"Provide inputs for fixed bias functions.\"\"\"\n    fwd = mne.read_forward_solution(fname_fwd)\n    fwd = mne.convert_forward_solution(fwd, force_fixed=True, surf_ori=True)\n    return _bias_params(evoked, noise_cov, fwd)\n\n\ndef _bias_params(evoked, noise_cov, fwd):\n    evoked.pick_types(meg=True, eeg=True, exclude=())\n    # restrict to limited set of verts (small src here) and one hemi for speed\n    vertices = [fwd['src'][0]['vertno'].copy(), []]\n    stc = mne.SourceEstimate(np.zeros((sum(len(v) for v in vertices), 1)),\n                             vertices, 0., 1.)\n    fwd = mne.forward.restrict_forward_to_stc(fwd, stc)\n    assert fwd['sol']['row_names'] == noise_cov['names']\n    assert noise_cov['names'] == evoked.ch_names\n    evoked = mne.EvokedArray(fwd['sol']['data'].copy(), evoked.info)\n    data_cov = noise_cov.copy()\n    data_cov['data'] = np.dot(fwd['sol']['data'], fwd['sol']['data'].T)\n    assert data_cov['data'].shape[0] == len(noise_cov['names'])\n    want = np.arange(fwd['sol']['data'].shape[1])\n    if not mne.forward.is_fixed_orient(fwd):\n        want //= 3\n    return evoked, fwd, noise_cov, data_cov, want\n\n\n@pytest.fixture(scope=\"module\", params=[\n    \"mayavi\",\n    \"pyvista\",\n])\ndef backend_name(request):\n    \"\"\"Get the backend name.\"\"\"\n    yield request.param\n\n\n@pytest.yield_fixture\ndef renderer(backend_name):\n    \"\"\"Yield the 3D backends.\"\"\"\n    from mne.viz.backends.renderer import _use_test_3d_backend\n    from mne.viz.backends.tests._utils import has_mayavi, has_pyvista\n    if backend_name == 'mayavi':\n        if not has_mayavi():\n            pytest.skip(\"Test skipped, requires mayavi.\")\n    elif backend_name == 'pyvista':\n        if not has_pyvista():\n            pytest.skip(\"Test skipped, requires pyvista.\")\n    with _use_test_3d_backend(backend_name):\n        from mne.viz.backends import renderer\n        yield renderer\n        renderer._close_all()\n", "path": "mne/conftest.py"}]}