Improve test resiliance
This commit is contained in:
parent
2c94ed2e59
commit
564318415e
@ -207,12 +207,15 @@ async def test_emc_create_connection_invalid_port(default_conf, caplog, mocker):
|
||||
})
|
||||
|
||||
dp = DataProvider(default_conf, None, None, None)
|
||||
# Handle start explicitly to avoid messing with threading in tests
|
||||
mocker.patch("freqtrade.rpc.external_message_consumer.ExternalMessageConsumer.start",)
|
||||
emc = ExternalMessageConsumer(default_conf, dp)
|
||||
|
||||
try:
|
||||
await asyncio.sleep(0.01)
|
||||
await emc._create_connection(emc.producers[0], asyncio.Lock())
|
||||
assert log_has_re(r".+ is an invalid WebSocket URL .+", caplog)
|
||||
finally:
|
||||
emc._running = False
|
||||
emc.shutdown()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user