chore: fix mote A violations in tests and scripts

This commit is contained in:
Matthias 2024-07-05 08:54:49 +02:00
parent 4a4e6bc952
commit 1e287de589
5 changed files with 18 additions and 18 deletions

View File

@ -133,8 +133,8 @@ def test_FtRestClient_call_invalid(caplog):
)
def test_FtRestClient_call_explicit_methods(method, args, kwargs):
client, mock = get_rest_client()
exec = getattr(client, method)
exec(*args, **kwargs)
executor = getattr(client, method)
executor(*args, **kwargs)
assert mock.call_count == 1

View File

@ -172,10 +172,10 @@ class ClientProtocol:
return readable_timedelta(time_delta)
async def _handle_whitelist(self, name, type, data):
async def _handle_whitelist(self, name, msgtype, data):
self.logger.info(data)
async def _handle_analyzed_df(self, name, type, data):
async def _handle_analyzed_df(self, name, msgtype, data):
key, la, df = data["key"], data["la"], data["df"]
if not df.empty:
@ -189,8 +189,8 @@ class ClientProtocol:
else:
self.logger.info("Empty DataFrame")
async def _handle_default(self, name, type, data):
self.logger.info("Unknown message of type {type} received...")
async def _handle_default(self, name, msgtype, data):
self.logger.info("Unknown message of type {msgtype} received...")
self.logger.info(data)

View File

@ -83,7 +83,7 @@ def test_datahandler_ohlcv_regex(filename, pair, timeframe, candletype):
@pytest.mark.parametrize(
"input,expected",
"pair,expected",
[
("XMR_USDT", "XMR/USDT"),
("BTC_USDT", "BTC/USDT"),
@ -95,8 +95,8 @@ def test_datahandler_ohlcv_regex(filename, pair, timeframe, candletype):
("UNITTEST_USDT", "UNITTEST/USDT"),
],
)
def test_rebuild_pair_from_filename(input, expected):
assert IDataHandler.rebuild_pair_from_filename(input) == expected
def test_rebuild_pair_from_filename(pair, expected):
assert IDataHandler.rebuild_pair_from_filename(pair) == expected
def test_datahandler_ohlcv_get_available_data(testdatadir):

View File

@ -12,7 +12,7 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
@pytest.mark.parametrize(
"side,type,time_in_force,expected",
"side,order_type,time_in_force,expected",
[
("buy", "limit", "gtc", {"timeInForce": "GTC"}),
("buy", "limit", "IOC", {"timeInForce": "IOC"}),
@ -22,9 +22,9 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
("sell", "market", "PO", {}),
],
)
def test__get_params_binance(default_conf, mocker, side, type, time_in_force, expected):
def test__get_params_binance(default_conf, mocker, side, order_type, time_in_force, expected):
exchange = get_patched_exchange(mocker, default_conf, id="binance")
assert exchange._get_params(side, type, 1, False, time_in_force) == expected
assert exchange._get_params(side, order_type, 1, False, time_in_force) == expected
@pytest.mark.parametrize("trademode", [TradingMode.FUTURES, TradingMode.SPOT])

View File

@ -4,7 +4,7 @@ from freqtrade.enums import CandleType
@pytest.mark.parametrize(
"input,expected",
"candle_type,expected",
[
("", CandleType.SPOT),
("spot", CandleType.SPOT),
@ -17,17 +17,17 @@ from freqtrade.enums import CandleType
("premiumIndex", CandleType.PREMIUMINDEX),
],
)
def test_CandleType_from_string(input, expected):
assert CandleType.from_string(input) == expected
def test_CandleType_from_string(candle_type, expected):
assert CandleType.from_string(candle_type) == expected
@pytest.mark.parametrize(
"input,expected",
"candle_type,expected",
[
("futures", CandleType.FUTURES),
("spot", CandleType.SPOT),
("margin", CandleType.SPOT),
],
)
def test_CandleType_get_default(input, expected):
assert CandleType.get_default(input) == expected
def test_CandleType_get_default(candle_type, expected):
assert CandleType.get_default(candle_type) == expected