Merge pull request #2850 from freqtrade/try_fix_randoM-test

make sure asyncio_loop is not initialized within ccxt code
This commit is contained in:
hroff-1902 2020-02-03 17:45:49 +03:00 committed by GitHub
commit 64f04845b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,9 +76,11 @@ def test_init_ccxt_kwargs(default_conf, mocker, caplog):
mocker.patch('freqtrade.exchange.Exchange.validate_stakecurrency') mocker.patch('freqtrade.exchange.Exchange.validate_stakecurrency')
caplog.set_level(logging.INFO) caplog.set_level(logging.INFO)
conf = copy.deepcopy(default_conf) conf = copy.deepcopy(default_conf)
conf['exchange']['ccxt_async_config'] = {'aiohttp_trust_env': True} conf['exchange']['ccxt_async_config'] = {'aiohttp_trust_env': True, 'asyncio_loop': True}
ex = Exchange(conf) ex = Exchange(conf)
assert log_has("Applying additional ccxt config: {'aiohttp_trust_env': True}", caplog) assert log_has(
"Applying additional ccxt config: {'aiohttp_trust_env': True, 'asyncio_loop': True}",
caplog)
assert ex._api_async.aiohttp_trust_env assert ex._api_async.aiohttp_trust_env
assert not ex._api.aiohttp_trust_env assert not ex._api.aiohttp_trust_env
@ -86,6 +88,8 @@ def test_init_ccxt_kwargs(default_conf, mocker, caplog):
caplog.clear() caplog.clear()
conf = copy.deepcopy(default_conf) conf = copy.deepcopy(default_conf)
conf['exchange']['ccxt_config'] = {'TestKWARG': 11} conf['exchange']['ccxt_config'] = {'TestKWARG': 11}
conf['exchange']['ccxt_async_config'] = {'asyncio_loop': True}
ex = Exchange(conf) ex = Exchange(conf)
assert not log_has("Applying additional ccxt config: {'aiohttp_trust_env': True}", caplog) assert not log_has("Applying additional ccxt config: {'aiohttp_trust_env': True}", caplog)
assert not ex._api_async.aiohttp_trust_env assert not ex._api_async.aiohttp_trust_env