
    iP                     0    d Z ddlZddlZd Zd Zd Zd Zy)zTests for mlx_audio.dsp module.    Nc                      d} t        j                  t        j                  d| gdd      }|j                  dk(  sJ d|j
                          y)zrVerify dsp.py doesn't import TTS/STT modules.

    Runs in subprocess to avoid interference with other tests.
    z
import sys
from mlx_audio.dsp import stft
assert "mlx_audio.tts" not in sys.modules, "TTS was imported"
assert "mlx_audio.stt" not in sys.modules, "STT was imported"
print("OK")
-cTcapture_outputtextr   zImport isolation failed: N
subprocessrunsys
executable
returncodestderrcoderesults     m/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/mlx_audio/tests/test_dsp.pytest_dsp_import_isolationr      sT    
D ^^	t$F
 !N%>v}}o#NN!    c                      ddl m} m}m}m} t        |      sJ t        |      sJ t        |      sJ t        |       sJ y)z<Verify backward compatible imports from utils.py still work.r   hanningistftmel_filtersstftN)mlx_audio.utilsr   r   r   r   callabler   s       r   test_dsp_backward_compatr      s<    AAD>>E??K   Gr   c                  R    ddl m}  g d}|D ]  }t        | |      rJ d|         y)z&Verify __all__ exports work correctly.r   )dsp)r   hammingblackmanbartlettSTR_TO_WINDOW_FNr   r   r   zMissing export: N)	mlx_audior   hasattr)r   expectednames      r   test_dsp_all_exportsr(   %   s5    	H sD!<%5dV#<<! r   c                      d} t        j                  t        j                  d| gdd      }|j                  dk(  sJ d|j
                          y)zsVerify utils.py uses lazy imports for TTS/STT.

    Runs in subprocess to avoid interference with other tests.
    z
import sys
from mlx_audio.utils import stft
assert "mlx_audio.tts.utils" not in sys.modules, "TTS utils was imported"
assert "mlx_audio.stt.utils" not in sys.modules, "STT utils was imported"
print("OK")
r   Tr   r   zLazy import failed: Nr   r   s     r   test_utils_lazy_importsr*   8   sT    
D ^^	t$F
 !I%9&--#II!r   )__doc__r	   r   r   r   r(   r*    r   r   <module>r-      s$    %  
O(=&Jr   