Skip to content

Commit f21086e

Browse files
authored
Skip streaming integration tests if REPLICATE_API_TOKEN isn't set (#316)
Unblocks #309 Signed-off-by: Mattt Zmuda <[email protected]>
1 parent b86aca7 commit f21086e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_stream.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import os
2+
13
import pytest
24

35
import replicate
46
from replicate.stream import ServerSentEvent
57

8+
skip_if_no_token = pytest.mark.skipif(
9+
os.environ.get("REPLICATE_API_TOKEN") is None, reason="REPLICATE_API_TOKEN not set"
10+
)
11+
612

13+
@skip_if_no_token
714
@pytest.mark.asyncio
815
@pytest.mark.parametrize("async_flag", [True, False])
916
async def test_stream(async_flag, record_mode):
@@ -32,6 +39,7 @@ async def test_stream(async_flag, record_mode):
3239
assert any(event.event == ServerSentEvent.EventType.DONE for event in events)
3340

3441

42+
@skip_if_no_token
3543
@pytest.mark.asyncio
3644
@pytest.mark.parametrize("async_flag", [True, False])
3745
async def test_stream_prediction(async_flag, record_mode):

0 commit comments

Comments
 (0)