-
Notifications
You must be signed in to change notification settings - Fork 0
Run project tests and debug failures #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| """Tests for arpeggiator functionality.""" | ||
|
|
||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| from unittest.mock import patch | ||
| from PyQt5.QtWidgets import QApplication | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| """Comprehensive unit tests for the controller functionality.""" | ||
|
|
||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| import time | ||
| from unittest.mock import patch, MagicMock | ||
| import threading | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,16 @@ | ||
| """Integration tests covering keyboard events routed through the controller.""" | ||
|
|
||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| from types import SimpleNamespace | ||
| from unittest.mock import Mock, patch, call | ||
|
|
||
| import pytest | ||
|
|
||
| from qwerty_synth import config, controller | ||
| from qwerty_synth.keyboard_midi import MidiEvent | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| """Integration tests covering keyboard translator to controller flows.""" | ||
|
|
||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| from unittest.mock import Mock | ||
|
|
||
| import pytest | ||
| from pynput.keyboard import Key, KeyCode | ||
|
|
||
| from qwerty_synth import config, controller | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| """Integration test for MIDI controller → controller flow.""" | ||
|
|
||
| from unittest.mock import Mock, MagicMock, patch | ||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| from unittest.mock import Mock, MagicMock, patch | ||
|
|
||
| from qwerty_synth import config, controller | ||
| from qwerty_synth.midi_input import MidiPortTranslator | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| """Comprehensive unit tests for the core synthesizer functionality.""" | ||
|
|
||
| import pytest | ||
|
|
||
| # Skip entire module if sounddevice/PortAudio is not available | ||
| try: | ||
| import sounddevice | ||
|
||
| except OSError: | ||
| pytest.skip("PortAudio library not found", allow_module_level=True) | ||
|
|
||
| import numpy as np | ||
| from unittest.mock import patch, Mock | ||
| import threading | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] A
requires_portaudiomarker is defined here but is never used. The test modules use module-levelpytest.skip()instead. This creates two different mechanisms for the same purpose, which could lead to confusion.Consider either:
@requires_portaudiodecorators on test functions/classes instead of module-level skipsThe current implementation works correctly, but having both mechanisms reduces code clarity.