diff --git a/freqtrade/tests/rpc/test_rpc_apiserver.py b/freqtrade/tests/rpc/test_rpc_apiserver.py index 41d682d2d..8752207d0 100644 --- a/freqtrade/tests/rpc/test_rpc_apiserver.py +++ b/freqtrade/tests/rpc/test_rpc_apiserver.py @@ -121,6 +121,13 @@ def test_api_run(default_conf, mocker, caplog): "e.g 127.0.0.1 in config.json", caplog.record_tuples) + # Test crashing flask + caplog.clear() + apiserver.app.run = MagicMock(side_effect=Exception) + apiserver.run() + assert log_has("Api server failed to start, exception message is:", + caplog.record_tuples) + def test_api_reloadconf(botclient): ftbot, client = botclient