Skip to content

Commit b466cc2

Browse files
committed
[Test] skip WS test on github CI
1 parent e4d7ced commit b466cc2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ def _tentacles_local_path():
7373
_cleanup()
7474

7575

76+
@pytest_asyncio.fixture
77+
async def skipped_on_github_CI():
78+
if _is_on_github_ci():
79+
pytest.skip(reason="test skipped on github CI")
80+
81+
82+
def _is_on_github_ci():
83+
# Always set to true when GitHub Actions is running the workflow.
84+
# You can use this variable to differentiate when tests are being run locally or by GitHub Actions.
85+
# from https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
86+
return bool(os.getenv("GITHUB_ACTIONS"))
87+
88+
7689
def _configure_async_test_loop():
7790
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
7891
# use WindowsSelectorEventLoopPolicy to avoid aiohttp connexion close warnings

tests/exchanges/implementations/test_default_websocket_exchange.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import pytest
2323

2424
from tests.exchanges import liquid_exchange_manager as liquid_exchange_manager_fixture, DEFAULT_EXCHANGE_NAME
25+
from tests import skipped_on_github_CI
2526

2627
# All test coroutines will be treated as marked.
2728
pytestmark = pytest.mark.asyncio
@@ -123,7 +124,7 @@ def default_websocket_exchange(liquid_exchange_manager_fixture):
123124
yield MockedWebSocketExchange(liquid_exchange_manager_fixture.config, liquid_exchange_manager_fixture)
124125

125126

126-
async def test_start_receive_feeds_and_stop(default_websocket_exchange):
127+
async def test_start_receive_feeds_and_stop(default_websocket_exchange, skipped_on_github_CI):
127128
await default_websocket_exchange.init_websocket(
128129
default_websocket_exchange.exchange_manager.exchange_config.traded_time_frames,
129130
default_websocket_exchange.exchange_manager.exchange_config.traded_symbol_pairs,

0 commit comments

Comments
 (0)