Skip to content

Commit 3b6395d

Browse files
committed
test: improve ccxt compat test teardown
1 parent fdcbb3c commit 3b6395d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/exchange_online/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,16 @@ def get_futures_exchange(exchange_name, exchange_conf, class_mocker):
570570
@pytest.fixture(params=EXCHANGES, scope="class")
571571
def exchange(request, exchange_conf, class_mocker):
572572
class_mocker.patch("freqtrade.exchange.bybit.Bybit.additional_exchange_init")
573-
return get_exchange(request.param, exchange_conf)
573+
exchange, name = get_exchange(request.param, exchange_conf)
574+
yield exchange, name
575+
exchange.close()
574576

575577

576578
@pytest.fixture(params=EXCHANGES, scope="class")
577579
def exchange_futures(request, exchange_conf, class_mocker):
578-
return get_futures_exchange(request.param, exchange_conf, class_mocker)
580+
exchange, name = get_futures_exchange(request.param, exchange_conf, class_mocker)
581+
yield exchange, name
582+
exchange.close()
579583

580584

581585
@pytest.fixture(params=["spot", "futures"], scope="class")

0 commit comments

Comments
 (0)