@@ -859,7 +859,7 @@ def test_validate_pricing(default_conf, mocker):
859859 default_conf ["exchange" ]["name" ] = "binance"
860860 ExchangeResolver .load_exchange (default_conf )
861861 has .update ({"fetchTicker" : False })
862- with pytest .raises (OperationalException , match = "Ticker pricing not available for .*" ):
862+ with pytest .raises (OperationalException , match = r "Ticker pricing not available for .*" ):
863863 ExchangeResolver .load_exchange (default_conf )
864864
865865 has .update ({"fetchTicker" : True })
@@ -868,7 +868,7 @@ def test_validate_pricing(default_conf, mocker):
868868 ExchangeResolver .load_exchange (default_conf )
869869 has .update ({"fetchL2OrderBook" : False })
870870
871- with pytest .raises (OperationalException , match = "Orderbook not available for .*" ):
871+ with pytest .raises (OperationalException , match = r "Orderbook not available for .*" ):
872872 ExchangeResolver .load_exchange (default_conf )
873873
874874 has .update ({"fetchL2OrderBook" : True })
@@ -877,7 +877,7 @@ def test_validate_pricing(default_conf, mocker):
877877 default_conf ["trading_mode" ] = TradingMode .FUTURES
878878 default_conf ["margin_mode" ] = MarginMode .ISOLATED
879879
880- with pytest .raises (OperationalException , match = "Ticker pricing not available for .*" ):
880+ with pytest .raises (OperationalException , match = r "Ticker pricing not available for .*" ):
881881 ExchangeResolver .load_exchange (default_conf )
882882
883883
@@ -3556,7 +3556,7 @@ def test_get_historic_trades_notsupported(
35563556 pair = "ETH/BTC"
35573557
35583558 with pytest .raises (
3559- OperationalException , match = "This exchange does not support downloading Trades."
3559+ OperationalException , match = r "This exchange does not support downloading Trades\ ."
35603560 ):
35613561 exchange .get_historic_trades (pair , since = trades_history [0 ][0 ], until = trades_history [- 1 ][0 ])
35623562
@@ -4442,7 +4442,7 @@ def test_get_markets(
44424442def test_get_markets_error (default_conf , mocker ):
44434443 ex = get_patched_exchange (mocker , default_conf )
44444444 mocker .patch (f"{ EXMS } .markets" , PropertyMock (return_value = None ))
4445- with pytest .raises (OperationalException , match = "Markets were not loaded." ):
4445+ with pytest .raises (OperationalException , match = r "Markets were not loaded\ ." ):
44464446 ex .get_markets ("LTC" , "USDT" , True , False )
44474447
44484448
@@ -5243,7 +5243,7 @@ def test__fetch_and_calculate_funding_fees(
52435243 # Return empty "refresh_latest"
52445244 mocker .patch (f"{ EXMS } .refresh_latest_ohlcv" , return_value = {})
52455245 ex = get_patched_exchange (mocker , default_conf , api_mock , exchange = exchange )
5246- with pytest .raises (ExchangeError , match = "Could not find funding rates." ):
5246+ with pytest .raises (ExchangeError , match = r "Could not find funding rates\ ." ):
52475247 ex ._fetch_and_calculate_funding_fees (
52485248 pair = "ADA/USDT:USDT" , amount = amount , is_short = False , open_date = d1 , close_date = d2
52495249 )
0 commit comments