π π A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
tests: Fix typing of WAV fixture helpers
Christopher Jacobydf93093e11b9
diff --git a/tests/test_wav_header_length.py b/tests/test_wav_header_length.pyindex af2247c..bba2e3c 100644--- a/tests/test_wav_header_length.py+++ b/tests/test_wav_header_length.py@@ -3,6 +3,7 @@import structfrom io import BytesIOfrom pathlib import Path+from typing import BinaryIO, Optionalimport numpy as npimport pytest@@ -26,12 +27,13 @@ def _chunk(tag, payload, declared_size=None):)-def _fmt(*, tag=1, bits=16, block_align=None, guid=None):+def _fmt(*, tag=1, bits=16, block_align=None, guid: Optional[bytes] = None):alignment = NUM_CHANNELS * ((bits + 7) // 8) if block_align is None else block_alignresult = struct.pack("<HHIIHH", tag, NUM_CHANNELS, SAMPLE_RATE, SAMPLE_RATE * alignment, alignment, bits)if tag == 0xFFFE:+ assert guid is not Noneresult += struct.pack("<HHI", 22, bits, 3) + guidreturn result@@ -283,7 +285,7 @@ def test_wav_legacy_oversized_bit_depth_preserves_accepted_pcm(data_size):np.testing.assert_array_equal(*decoded)-class _BoundedStream:+class _BoundedStream(BinaryIO):"""Fail the test instead of hanging if parsing stops making progress."""def __init__(self, contents, operation_budget=256):