Skip to content

Conversation

@yprez
Copy link
Owner

@yprez yprez commented Nov 11, 2025

Add module-level skip logic to tests that depend on sounddevice/PortAudio. When the PortAudio system library is not installed, these test modules will be skipped gracefully instead of failing at import time.

Changes:

  • Add PortAudio availability check in conftest.py
  • Update 6 test modules to skip when PortAudio is missing
  • Tests now run successfully even without PortAudio installed

Add module-level skip logic to tests that depend on sounddevice/PortAudio.
When the PortAudio system library is not installed, these test modules will
be skipped gracefully instead of failing at import time.

Changes:
- Add PortAudio availability check in conftest.py
- Update 6 test modules to skip when PortAudio is missing
- Tests now run successfully even without PortAudio installed
@yprez
Copy link
Owner Author

yprez commented Nov 11, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds graceful handling for missing PortAudio dependencies in the test suite. When the PortAudio system library is not installed, test modules that depend on sounddevice will now be skipped at the module level instead of failing at import time.

  • Added is_portaudio_available() check function and requires_portaudio marker in conftest.py
  • Implemented module-level skip logic in 6 test files that transitively depend on sounddevice
  • Updated mock_oscillator fixture to skip when PortAudio is unavailable

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/conftest.py Added PortAudio availability check function, pytest marker, and conditional skip in mock_oscillator fixture
tests/test_synth.py Added module-level skip when sounddevice/PortAudio is not available
tests/test_controller.py Added module-level skip when sounddevice/PortAudio is not available
tests/test_midi_integration.py Added module-level skip when sounddevice/PortAudio is not available, moved pytest import to top
tests/test_keyboard_integration.py Added module-level skip when sounddevice/PortAudio is not available, reordered pytest import
tests/test_input.py Added module-level skip when sounddevice/PortAudio is not available, reordered pytest import
tests/test_arpeggiator.py Added module-level skip when sounddevice/PortAudio is not available

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +27
# Create a pytest marker for tests requiring PortAudio
requires_portaudio = pytest.mark.skipif(
not is_portaudio_available(),
reason="PortAudio library not found (install portaudio19-dev system package)"
)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] A requires_portaudio marker is defined here but is never used. The test modules use module-level pytest.skip() instead. This creates two different mechanisms for the same purpose, which could lead to confusion.

Consider either:

  1. Removing this unused marker if module-level skips are the preferred approach, or
  2. Using this marker with @requires_portaudio decorators on test functions/classes instead of module-level skips

The current implementation works correctly, but having both mechanisms reduces code clarity.

Suggested change
# Create a pytest marker for tests requiring PortAudio
requires_portaudio = pytest.mark.skipif(
not is_portaudio_available(),
reason="PortAudio library not found (install portaudio19-dev system package)"
)

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.

# Skip entire module if sounddevice/PortAudio is not available
try:
import sounddevice
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'sounddevice' is not used.

Copilot uses AI. Check for mistakes.
@yprez yprez merged commit 9876a01 into main Nov 11, 2025
7 checks passed
@yprez yprez deleted the claude/run-project-tests-011CV1dDiz4sMzXLrJmCqF9W branch November 11, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants