Skip to content

Commit

Permalink
FIX: Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Mar 12, 2024
1 parent 74bb767 commit 4ac59bf
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions mne/viz/backends/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import platform
from colorsys import rgb_to_hls
from contextlib import nullcontext

import numpy as np
import pytest
Expand Down Expand Up @@ -66,19 +65,7 @@ def test_theme_colors(pg_backend, theme, monkeypatch, tmp_path):
monkeypatch.setattr(darkdetect, "theme", lambda: "light")
raw = RawArray(np.zeros((1, 1000)), create_info(1, 1000.0, "eeg"))
_, api = _check_qt_version(return_api=True)
if api in ("PyQt6", "PySide6"):
if theme == "dark": # we force darkdetect to say the sys is light
ctx = pytest.warns(RuntimeWarning, match="not yet supported")
else:
ctx = nullcontext()
return_early = True
else:
ctx = nullcontext()
return_early = False
with ctx:
fig = raw.plot(theme=theme)
if return_early:
return # we could add a ton of conditionals below, but KISS
fig = raw.plot(theme=theme)
is_dark = _qt_is_dark(fig)
# on Darwin these checks get complicated, so don't bother for now
if platform.system() == "Darwin":
Expand Down

0 comments on commit 4ac59bf

Please sign in to comment.