Skip to content

Commit

Permalink
remove: midi from test again and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jo47011 committed Dec 4, 2024
1 parent 10e76f3 commit 102df11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install .$(python scripts/extract_dependencies.py --exclude doc dev)
pip uninstall python-rtmidi -y
pip install .$(python scripts/extract_dependencies.py --exclude doc dev midi)
- name: Install and pack web ui assets
run: |
npm install
Expand Down Expand Up @@ -103,7 +102,6 @@ jobs:
python -m pip install --upgrade pip
mkdir _static
pip install .$(python scripts/extract_dependencies.py --exclude test dev)
- name: Build HTML docs with Sphinx
run: |
cd docs
Expand Down
13 changes: 7 additions & 6 deletions test/interfaces/test_midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import unittest
import unittest.mock

import mido
import shc.interfaces.midi
from shc.datatypes import RangeUInt8

from .._helper import InterfaceThreadRunner


try:
import mido
import shc.interfaces.midi
from shc.datatypes import RangeUInt8

mido.backend.load()
mido_backend_available = True
mido_backend_error = ""
Expand All @@ -18,6 +18,7 @@
mido_backend_error = str(e)


@unittest.skipUnless(mido_backend_available, "mido MIDI backend is not available: {}".format(mido_backend_error))
class MIDITest(unittest.TestCase):
def test_errors(self) -> None:
with self.assertRaises(ValueError):
Expand All @@ -31,7 +32,7 @@ def test_errors(self) -> None:
interface.note_velocity(42)


@unittest.skipUnless(mido_backend_available, "mido MIDI backend is not awailable: {}".format(mido_backend_error))
@unittest.skipUnless(mido_backend_available, "mido MIDI backend is not available: {}".format(mido_backend_error))
class MIDIInputTest(unittest.TestCase):
def setUp(self) -> None:
self.port_name = 'TestOutPort' + self.id().split('.')[-1]
Expand Down Expand Up @@ -137,7 +138,7 @@ def test_emulated_toggle(self) -> None:
publish_mock.assert_called_once_with(False, unittest.mock.ANY)


@unittest.skipUnless(mido_backend_available, "mido MIDI backend is not awailable: {}".format(mido_backend_error))
@unittest.skipUnless(mido_backend_available, "mido MIDI backend is not available: {}".format(mido_backend_error))
class MIDIOutputTest(unittest.TestCase):
def setUp(self) -> None:
self.port_name = 'TestInPort' + self.id().split('.')[-1]
Expand Down

0 comments on commit 102df11

Please sign in to comment.