11"""Unit tests for the Live client."""
22import asyncio
33import pathlib
4+ import platform
45from io import BytesIO
56from typing import Callable
67from unittest .mock import MagicMock
@@ -370,9 +371,10 @@ def test_live_stop(
370371 schema = Schema .MBO ,
371372 )
372373
373- live_client .start ()
374374 assert live_client .is_connected () is True
375375
376+ live_client .start ()
377+
376378 live_client .stop ()
377379 live_client .block_for_close ()
378380
@@ -431,7 +433,6 @@ def test_live_block_for_close_timeout(
431433 symbols = "*" ,
432434 start = None ,
433435 )
434- live_client .start ()
435436 live_client .block_for_close (timeout = 0 )
436437 live_client .terminate .assert_called_once () # type: ignore
437438
@@ -557,6 +558,7 @@ def test_live_add_stream_invalid(
557558
558559
559560@pytest .mark .asyncio
561+ @pytest .mark .skipif (platform .system () == "Darwin" , reason = "flaky on MacOS runner" )
560562async def test_live_async_iteration (
561563 live_client : client .Live ,
562564) -> None :
@@ -583,6 +585,7 @@ async def test_live_async_iteration(
583585
584586
585587@pytest .mark .asyncio
588+ @pytest .mark .skipif (platform .system () == "Darwin" , reason = "flaky on MacOS runner" )
586589async def test_live_async_iteration_backpressure (
587590 live_client : client .Live ,
588591 monkeypatch : pytest .MonkeyPatch ,
@@ -628,6 +631,7 @@ async def test_live_async_iteration_backpressure(
628631
629632
630633@pytest .mark .asyncio
634+ @pytest .mark .skipif (platform .system () == "Darwin" , reason = "flaky on MacOS runner" )
631635async def test_live_async_iteration_dropped (
632636 live_client : client .Live ,
633637 monkeypatch : pytest .MonkeyPatch ,
@@ -670,6 +674,7 @@ async def test_live_async_iteration_dropped(
670674
671675
672676@pytest .mark .asyncio
677+ @pytest .mark .skipif (platform .system () == "Darwin" , reason = "flaky on MacOS runner" )
673678async def test_live_async_iteration_stop (
674679 live_client : client .Live ,
675680) -> None :
@@ -697,6 +702,7 @@ async def test_live_async_iteration_stop(
697702 assert isinstance (records [2 ], databento_dbn .MBOMsg )
698703
699704
705+ @pytest .mark .skipif (platform .system () == "Darwin" , reason = "flaky on MacOS runner" )
700706def test_live_sync_iteration (
701707 live_client : client .Live ,
702708) -> None :
0 commit comments