Skip to content

Commit

Permalink
tests: skip DirectSound tests under CI
Browse files Browse the repository at this point in the history
  • Loading branch information
benmoran56 committed Feb 29, 2024
1 parent 0dcf7b3 commit 029aef4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unittests.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -33,7 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: msys2/setup-msys2@v2
Expand Down
16 changes: 5 additions & 11 deletions tests/integration/media/test_directsound.py
Expand Up @@ -6,20 +6,14 @@
import random
import time

import pytest
from ...annotations import skip_if_continuous_integration, require_platform, Platform

from pyglet.media.codecs import AudioFormat
import pyglet
_debug = False
pyglet.options['debug_media'] = _debug

try:
from pyglet.media.drivers import directsound
from pyglet.media.drivers.directsound.interface import DirectSoundDriver, DirectSoundBuffer
from pyglet.media.drivers.directsound.adaptation import _gain2db, _db2gain
except ImportError:
directsound = None

import pytest
pytestmark = pytest.mark.skipif(directsound is None, reason='No DirectSound available.')
pytestmark = [skip_if_continuous_integration(), require_platform(Platform.WINDOWS)]


def almost_equal(a, b, e=0.0001):
assert abs(a-b) <= e
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/media/test_listener.py
Expand Up @@ -2,6 +2,7 @@

from ...annotations import skip_if_continuous_integration

pytestmark = skip_if_continuous_integration()

try:
from pyglet.media.drivers import pulse
Expand Down Expand Up @@ -40,7 +41,6 @@ def check_modifying_values(listener):
assert listener.up_orientation == (0, -1, 0)


@skip_if_continuous_integration()
@pytest.mark.skipif(not has_openal, reason="Test requires OpenAL")
def test_openal_listener():
driver = openal.create_audio_driver()
Expand All @@ -51,7 +51,6 @@ def test_openal_listener():
del listener


@skip_if_continuous_integration()
@pytest.mark.skipif(not has_pulse, reason="Test requires PulseAudio")
def test_pulse_listener():
driver = pulse.create_audio_driver()
Expand All @@ -62,7 +61,6 @@ def test_pulse_listener():
del listener


@skip_if_continuous_integration()
@pytest.mark.skipif(not has_directsound, reason="Test requires DirectSound")
def test_directsound_listener():
driver = directsound.create_audio_driver()
Expand Down

0 comments on commit 029aef4

Please sign in to comment.