From 1d5778a72c19aa689aa099d1a80bd72020807cea Mon Sep 17 00:00:00 2001 From: tecnovert Date: Mon, 19 Jan 2026 10:07:22 +0200 Subject: [PATCH] tests: add "fetchpricesthread" setting --- basicswap/basicswap.py | 15 ++++++++++----- tests/basicswap/test_btc_xmr.py | 10 +++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 2859613..24aff6d 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -1280,12 +1280,17 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): else: self.log.info("AMM autostart is disabled") - self._price_fetch_running = True - self._price_fetch_thread = threading.Thread( - target=self._backgroundPriceFetchLoop, daemon=True + if self.settings.get("fetchpricesthread", True): + self._price_fetch_running = True + self._price_fetch_thread = threading.Thread( + target=self._backgroundPriceFetchLoop, daemon=True + ) + self._price_fetch_thread.start() + self.log.info( + "Background price fetching {}".format( + "started" if self._price_fetch_running else "is disabled" + ) ) - self._price_fetch_thread.start() - self.log.info("Background price fetching started") if "htmlhost" in self.settings: self.log.info( diff --git a/tests/basicswap/test_btc_xmr.py b/tests/basicswap/test_btc_xmr.py index ae75a70..53a1e8e 100644 --- a/tests/basicswap/test_btc_xmr.py +++ b/tests/basicswap/test_btc_xmr.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2021-2024 tecnovert -# Copyright (c) 2024-2025 The Basicswap developers +# Copyright (c) 2024-2026 The Basicswap developers # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. @@ -921,10 +921,10 @@ class BasicSwapTest(TestFunctions): @classmethod def setUpClass(cls): super(BasicSwapTest, cls).setUpClass() - if False: - for client in cls.swap_clients: - client.log.safe_logs = True - client.log.safe_logs_prefix = b"tests" + + @classmethod + def addCoinSettings(cls, settings, datadir, node_id): + settings["fetchpricesthread"] = False def test_001_nested_segwit(self): # p2sh-p2wpkh