Esempio n. 1
0
def _check_pyqtgraph():
    try:
        import PyQt5  # noqa: F401
    except ModuleNotFoundError:
        pytest.skip('PyQt5 is not installed but needed for pyqtgraph!')
    if not _compare_version(_check_pyqt5_version(), '>=', '5.12'):
        pytest.skip(f'PyQt5 has version {_check_pyqt5_version()}'
                    f'but pyqtgraph needs >= 5.12!')
    try:
        import mne_qt_browser  # noqa: F401
    except Exception:
        pytest.skip('Requires mne_qt_browser')
Esempio n. 2
0
def _check_pyqtgraph():
    try:
        import PyQt5  # noqa: F401
    except ModuleNotFoundError:
        pytest.skip('PyQt5 is not installed but needed for pyqtgraph!')
    try:
        assert LooseVersion(_check_pyqt5_version()) >= LooseVersion('5.12')
    except AssertionError:
        pytest.skip(f'PyQt5 has version {_check_pyqt5_version()}'
                    f'but pyqtgraph needs >= 5.12!')
    try:
        import mne_qt_browser  # noqa: F401
    except Exception:
        pytest.skip('Requires mne_qt_browser')
Esempio n. 3
0
def _check_pyqtgraph(request):
    # Check PyQt5
    try:
        import PyQt5  # noqa: F401
    except ModuleNotFoundError:
        pytest.skip('PyQt5 is not installed but needed for pyqtgraph!')
    if not _compare_version(_check_pyqt5_version(), '>=', '5.12'):
        pytest.skip(f'PyQt5 has version {_check_pyqt5_version()}'
                    f'but pyqtgraph needs >= 5.12!')
    # Check mne-qt-browser
    try:
        import mne_qt_browser  # noqa: F401
        # Check mne-qt-browser version
        lower_2_0 = _compare_version(mne_qt_browser.__version__, '<', '0.2.0')
        m_name = request.function.__module__
        f_name = request.function.__name__
        if lower_2_0 and m_name in pre_2_0_skip_modules:
            pytest.skip(f'Test-Module "{m_name}" was skipped for'
                        f' mne-qt-browser < 0.2.0')
        elif lower_2_0 and f_name in pre_2_0_skip_funcs:
            pytest.skip(f'Test "{f_name}" was skipped for '
                        f'mne-qt-browser < 0.2.0')
    except Exception:
        pytest.skip('Requires mne_qt_browser')