From c9d4f666c5fa95e4671ea0a4258abf9ff69b7386 Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Thu, 8 Sep 2022 14:00:22 -0600 Subject: [PATCH] minor apiserver test change --- tests/rpc/test_rpc_apiserver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index de093b66f..6a37e7cdd 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -51,13 +51,15 @@ def botclient(default_conf, mocker): ftbot = get_patched_freqtradebot(mocker, default_conf) rpc = RPC(ftbot) mocker.patch('freqtrade.rpc.api_server.ApiServer.start_api', MagicMock()) + apiserver = None try: apiserver = ApiServer(default_conf) apiserver.add_rpc_handler(rpc) yield ftbot, TestClient(apiserver.app) # Cleanup ... ? finally: - apiserver.cleanup() + if apiserver: + apiserver.cleanup() ApiServer.shutdown()