Skip to content

Commit

Permalink
MRG: Fix pytest test discovery for MNE-Python devel versions (mne-too…
Browse files Browse the repository at this point in the history
…ls#9840)

* Typo

* MAINT: Cleaner and faster

Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
hoechenberger and larsoner authored Oct 13, 2021
1 parent 22728ce commit d32125d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions mne/decoding/tests/test_receptive_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def test_time_delay():
assert_array_equal(X_delayed[:ii, :, idx], 0.)


@pytest.mark.slowtest # slow on Azure
@pytest.mark.parametrize('n_jobs', n_jobs_test)
@requires_sklearn
def test_receptive_field_basic(n_jobs):
Expand Down
2 changes: 1 addition & 1 deletion mne/export/tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_rawarray_edf(tmp_path):
@pytest.mark.parametrize(
['dataset', 'format'], [
['test', 'edf'],
['misc', 'edf'],
pytest.param('misc', 'edf', marks=pytest.mark.slowtest),
])
def test_export_raw_edf(tmp_path, dataset, format):
"""Test saving a Raw instance to EDF format."""
Expand Down
2 changes: 2 additions & 0 deletions mne/report/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def test_report_raw_psd_and_date(tmpdir):
assert 'Unknown' in ''.join(report.html)


@pytest.mark.slowtest # slow for Mayavi on Azure
@testing.requires_testing_data
def test_render_add_sections(renderer, tmpdir):
"""Test adding figures/images to section."""
Expand Down Expand Up @@ -703,6 +704,7 @@ def test_manual_report_2d(tmpdir, invisible_fig):
r.save(fname=fname, open_browser=False)


@pytest.mark.slowtest # 30 sec on Azure for Mayavi
@testing.requires_testing_data
def test_manual_report_3d(tmpdir, renderer):
"""Simulate adding 3D sections."""
Expand Down
2 changes: 1 addition & 1 deletion mne/tests/test_bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_make_sphere_model():

@testing.requires_testing_data
@pytest.mark.parametrize('kwargs, fname', [
[dict(), fname_bem_3],
pytest.param(dict(), fname_bem_3, marks=pytest.mark.slowtest), # Azure
[dict(conductivity=[0.3]), fname_bem_1],
])
def test_make_bem_model(tmpdir, kwargs, fname):
Expand Down
3 changes: 2 additions & 1 deletion mne/viz/tests/test_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _assert_n_actors(fig, renderer, n_actors):
assert len(fig.plotter.renderer.actors) == n_actors


@pytest.mark.slowtest # Slow for Mayavi on Azure
@pytest.mark.parametrize('system', [
'Neuromag',
pytest.param('CTF', marks=testing._pytest_mark()),
Expand Down Expand Up @@ -641,8 +642,8 @@ def test_plot_dipole_orientations(renderer):
renderer.backend._close_all()


@pytest.mark.slowtest # slow for Mayavi on Azure
@testing.requires_testing_data
@traits_test
def test_snapshot_brain_montage(renderer):
"""Test snapshot brain montage."""
info = read_info(evoked_fname)
Expand Down
1 change: 1 addition & 0 deletions mne/viz/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def test_plot_csd():
plot_csd(csd, mode='coh') # Plot coherence


@pytest.mark.slowtest # Slow on Azure
@testing.requires_testing_data
def test_plot_chpi_snr():
"""Test plotting cHPI SNRs."""
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ addopts =
--doctest-ignore-import-errors --junit-xml=junit-results.xml
--ignore=doc --ignore=logo --ignore=examples --ignore=tutorials
--ignore=mne/gui/_*.py --ignore=mne/externals --ignore=mne/icons
--ignore=tools
--capture=sys
junit_family = xunit2

Expand Down

0 comments on commit d32125d

Please sign in to comment.