Skip to content

Commit

Permalink
MAINT: Patch old MNE ver test (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jul 27, 2023
1 parent 8ce2b26 commit 369c54b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/mne_1_4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/mne/viz/tests/test_raw.py b/mne/viz/tests/test_raw.py
index 5533b5870..56ff1e607 100644
--- a/mne/viz/tests/test_raw.py
+++ b/mne/viz/tests/test_raw.py
@@ -23,6 +23,7 @@ from mne.utils import (
get_config,
set_config,
_assert_no_instances,
+ check_version,
)
from mne.viz import plot_raw, plot_sensors
from mne.viz.utils import _fake_click, _fake_keypress
@@ -745,6 +746,7 @@ def test_plot_annotations(raw, browser_backend):
assert fig.mne.regions[0].isVisible()


+@pytest.mark.xfail(check_version("mne_qt_browser", "0.5.2"), reason="old behavior was wrong")
@pytest.mark.parametrize("hide_which", ([], [0], [1], [0, 1]))
def test_remove_annotations(raw, hide_which, browser_backend):
"""Test that right-click doesn't remove hidden annotation spans."""
12 changes: 7 additions & 5 deletions .github/workflows/qt_viz_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: | # use MNE main to ensure test files are available
set -e
set -eo pipefail
python -m pip install --upgrade pip
git clone -b ${MNE_BRANCH} --single-branch --branch main https://github.com/mne-tools/mne-python.git ../mne-python
python -m pip install -qe ../mne-python
Expand All @@ -85,8 +85,7 @@ jobs:
PIP_OPTION="[tests]"
fi
python -m pip install -ve .${PIP_OPTION} PyQt5
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
- run: ./tools/get_testing_version.sh
name: 'Get testing version'
working-directory: ../mne-python
- uses: actions/cache@v3
Expand Down Expand Up @@ -159,7 +158,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: | # use MNE main to ensure test files are available
set -e
set -eo pipefail
python -m pip install --upgrade pip
git clone -b ${MNE_BRANCH} --single-branch --branch main https://github.com/mne-tools/mne-python.git ../mne-python
python -m pip install -qe ../mne-python
Expand All @@ -176,7 +175,10 @@ jobs:
PIP_OPTION="[tests]"
fi
python -m pip install -ve .${PIP_OPTION} ${QT_LIB_INSTALL}
- shell: bash -el {0}
- name: Patch MNE 1.4 test
if: ${{ matrix.mne == '1.4' }}
run: patch -d ../mne-python < .github/workflows/mne_1_4.patch
- shell: bash -e {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
working-directory: ../mne-python
Expand Down

0 comments on commit 369c54b

Please sign in to comment.