Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit d999f3b

Browse files
committed
[Tests] skip HTX api test en github CI
1 parent de457e4 commit d999f3b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

tests/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# You should have received a copy of the GNU Lesser General Public
1515
# License along with this library.
1616
import mock
17+
import os
1718
import pytest
19+
import pytest_asyncio
1820
import ccxt.async_support
1921

2022

@@ -147,3 +149,16 @@ def __init__(self, ccxt_exchange, is_margin=False, is_future=False):
147149
self.is_api_permission_error = mock.Mock(return_value=False)
148150
self.is_authentication_error = mock.Mock(return_value=False)
149151
self.is_ip_whitelist_error = mock.Mock(return_value=False)
152+
153+
154+
def _is_on_github_ci():
155+
# Always set to true when GitHub Actions is running the workflow.
156+
# You can use this variable to differentiate when tests are being run locally or by GitHub Actions.
157+
# from https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
158+
return bool(os.getenv("GITHUB_ACTIONS"))
159+
160+
161+
@pytest_asyncio.fixture
162+
async def skipped_on_github_CI():
163+
if _is_on_github_ci():
164+
pytest.skip(reason="test skipped on github CI")

tests/exchanges/test_htx.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
import ccxt.async_support
1919
import trading_backend.exchanges as exchanges
2020
import tests.util.create_order_tests as create_order_tests
21-
from tests import htx_exchange
21+
from tests import htx_exchange, skipped_on_github_CI
2222

2323

2424
def test_get_name(htx_exchange):
2525
assert exchanges.HTX(htx_exchange).get_name() == ccxt.async_support.htx().id.lower()
2626

2727

2828
@pytest.mark.asyncio
29-
async def test_get_orders_parameters(htx_exchange):
29+
async def test_get_orders_parameters(htx_exchange, skipped_on_github_CI):
30+
# for some reason the htx API can't be reached on github CI
3031
exchange = exchanges.HTX(htx_exchange)
3132
with mock.patch.object(exchange._exchange.connector.client,
3233
"fetch_accounts", mock.AsyncMock(return_value=[{'id': 1}])):

0 commit comments

Comments
 (0)