Skip to content

Commit

Permalink
disable test on macOS CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Dec 3, 2024
1 parent 785d4c0 commit 2a73da2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stimuli/keyboard/tests/test_keyboard.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import platform

import pytest
from numpy.testing import assert_allclose
Expand All @@ -27,6 +28,10 @@ def _get_keys(keyboard: Keyboard) -> list[KeyEvent]:
return keys


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS", "") == "true" and platform.system() == "Darwin",
reason="Unreliable on macOS CIs.",
)
def test_keyboard_basic() -> None:
"""Test basic keyboard functionalities."""
kb = Keyboard()
Expand All @@ -44,6 +49,10 @@ def test_keyboard_basic() -> None:
assert_allclose(keys[0].release_time - keys[0].press_time, 0.1, atol=0.01)


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS", "") == "true" and platform.system() == "Darwin",
reason="Unreliable on macOS CIs.",
)
def test_keyboard_not_monitoring() -> None:
"""Test keyboard not monitoring."""
kb = Keyboard()
Expand All @@ -54,6 +63,10 @@ def test_keyboard_not_monitoring() -> None:
kb.stop()


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS", "") == "true" and platform.system() == "Darwin",
reason="Unreliable on macOS CIs.",
)
def test_keyboard_key_restriction() -> None:
"""Test monitoring specific keys."""
kb = Keyboard(keys="b")
Expand All @@ -70,6 +83,10 @@ def test_keyboard_key_restriction() -> None:
assert keys[0].key == "b"


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS", "") == "true" and platform.system() == "Darwin",
reason="Unreliable on macOS CIs.",
)
def test_keyboard_reset() -> None:
"""Test keyboard reset."""
kb = Keyboard()
Expand All @@ -84,6 +101,10 @@ def test_keyboard_reset() -> None:
assert t0 < kb.t0


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS", "") == "true" and platform.system() == "Darwin",
reason="Unreliable on macOS CIs.",
)
@pytest.mark.xfail(
os.getenv("GITHUB_ACTIONS", "") == "true", reason="Unreliable on CIs."
)
Expand Down

0 comments on commit 2a73da2

Please sign in to comment.