diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 6426e17..df76c03 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -12,6 +12,15 @@ load_dotenv() + +def pytest_collection_modifyitems(items): + """Mark all integration tests as flaky with auto-retry.""" + for item in items: + # Check if test is in the integration directory + if "integration" in str(item.fspath): + item.add_marker(pytest.mark.flaky(reruns=9, reruns_delay=1)) + + # Create output directory for test audio files OUTPUT_DIR = Path("output") OUTPUT_DIR.mkdir(exist_ok=True) diff --git a/tests/integration/test_tts_websocket_integration.py b/tests/integration/test_tts_websocket_integration.py index 5014dab..5e80321 100644 --- a/tests/integration/test_tts_websocket_integration.py +++ b/tests/integration/test_tts_websocket_integration.py @@ -34,7 +34,6 @@ def text_stream(): # Save the audio save_audio(audio_chunks, "test_websocket_streaming.mp3") - @pytest.mark.flaky(reruns=9, reruns_delay=1) @pytest.mark.parametrize( "model", [ @@ -226,7 +225,6 @@ async def text_stream(): save_audio(audio_chunks, "test_async_websocket_streaming.mp3") @pytest.mark.asyncio - @pytest.mark.flaky(reruns=9, reruns_delay=1) @pytest.mark.parametrize( "model", [