Merge pull request #9053 from freqtrade/dependabot/pip/develop/ruff-0.0.284

Bump ruff from 0.0.282 to 0.0.284
This commit is contained in:
Matthias 2023-08-14 13:22:47 +02:00 committed by GitHub
commit 018d3a3f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 22 deletions

View File

@ -375,7 +375,7 @@ class FreqaiDataDrawer:
num_keep = self.freqai_info["purge_old_models"]
if not num_keep:
return
elif type(num_keep) == bool:
elif isinstance(num_keep, bool):
num_keep = 2
model_folders = [x for x in self.full_path.iterdir() if x.is_dir()]

View File

@ -7,7 +7,7 @@
-r docs/requirements-docs.txt
coveralls==3.3.1
ruff==0.0.282
ruff==0.0.284
mypy==1.5.0
pre-commit==3.3.3
pytest==7.4.0

View File

@ -35,7 +35,7 @@ def test__get_params_binance(default_conf, mocker, side, type, time_in_force, ex
])
def test_create_stoploss_order_binance(default_conf, mocker, limitratio, expected, side, trademode):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
order_type = 'stop_loss_limit' if trademode == TradingMode.SPOT else 'stop'
api_mock.create_order = MagicMock(return_value={

View File

@ -1337,7 +1337,7 @@ def test_create_dry_run_order_market_fill(default_conf, mocker, side, rate, amou
@pytest.mark.parametrize("exchange_name", EXCHANGES)
def test_create_order(default_conf, mocker, side, ordertype, rate, marketprice, exchange_name):
api_mock = MagicMock()
order_id = 'test_prod_{}_{}'.format(side, randint(0, 10 ** 6))
order_id = f'test_prod_{side}_{randint(0, 10 ** 6)}'
api_mock.options = {} if not marketprice else {"createMarketBuyOrderRequiresPrice": True}
api_mock.create_order = MagicMock(return_value={
'id': order_id,
@ -1417,7 +1417,7 @@ def test_buy_dry_run(default_conf, mocker, exchange_name):
@pytest.mark.parametrize("exchange_name", EXCHANGES)
def test_buy_prod(default_conf, mocker, exchange_name):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
order_type = 'market'
time_in_force = 'gtc'
api_mock.options = {}
@ -1506,7 +1506,7 @@ def test_buy_prod(default_conf, mocker, exchange_name):
@pytest.mark.parametrize("exchange_name", EXCHANGES)
def test_buy_considers_time_in_force(default_conf, mocker, exchange_name):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
api_mock.options = {}
api_mock.create_order = MagicMock(return_value={
'id': order_id,
@ -1573,7 +1573,7 @@ def test_sell_dry_run(default_conf, mocker):
@pytest.mark.parametrize("exchange_name", EXCHANGES)
def test_sell_prod(default_conf, mocker, exchange_name):
api_mock = MagicMock()
order_id = 'test_prod_sell_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_sell_{randint(0, 10 ** 6)}'
order_type = 'market'
api_mock.options = {}
api_mock.create_order = MagicMock(return_value={
@ -1651,7 +1651,7 @@ def test_sell_prod(default_conf, mocker, exchange_name):
@pytest.mark.parametrize("exchange_name", EXCHANGES)
def test_sell_considers_time_in_force(default_conf, mocker, exchange_name):
api_mock = MagicMock()
order_id = 'test_prod_sell_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_sell_{randint(0, 10 ** 6)}'
api_mock.create_order = MagicMock(return_value={
'id': order_id,
'symbol': 'ETH/BTC',
@ -5357,7 +5357,7 @@ def test_get_liquidation_price(
])
def test_stoploss_contract_size(mocker, default_conf, contract_size, order_amount):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
api_mock.create_order = MagicMock(return_value={
'id': order_id,

View File

@ -16,7 +16,7 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
])
def test_create_stoploss_order_huobi(default_conf, mocker, limitratio, expected, side):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
order_type = 'stop-limit'
api_mock.create_order = MagicMock(return_value={

View File

@ -15,7 +15,7 @@ STOPLOSS_LIMIT_ORDERTYPE = 'stop-loss-limit'
def test_buy_kraken_trading_agreement(default_conf, mocker):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
order_type = 'limit'
time_in_force = 'ioc'
api_mock.options = {}
@ -56,7 +56,7 @@ def test_buy_kraken_trading_agreement(default_conf, mocker):
def test_sell_kraken_trading_agreement(default_conf, mocker):
api_mock = MagicMock()
order_id = 'test_prod_sell_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_sell_{randint(0, 10 ** 6)}'
order_type = 'market'
api_mock.options = {}
api_mock.create_order = MagicMock(return_value={
@ -181,7 +181,7 @@ def test_get_balances_prod(default_conf, mocker):
])
def test_create_stoploss_order_kraken(default_conf, mocker, ordertype, side, adjustedprice):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
api_mock.create_order = MagicMock(return_value={
'id': order_id,

View File

@ -17,7 +17,7 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
])
def test_create_stoploss_order_kucoin(default_conf, mocker, limitratio, expected, side, order_type):
api_mock = MagicMock()
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
order_id = f'test_prod_buy_{randint(0, 10 ** 6)}'
api_mock.create_order = MagicMock(return_value={
'id': order_id,
@ -136,7 +136,7 @@ def test_stoploss_adjust_kucoin(mocker, default_conf):
])
def test_kucoin_create_order(default_conf, mocker, side, ordertype, rate):
api_mock = MagicMock()
order_id = 'test_prod_{}_{}'.format(side, randint(0, 10 ** 6))
order_id = f'test_prod_{side}_{randint(0, 10 ** 6)}'
api_mock.create_order = MagicMock(return_value={
'id': order_id,
'info': {

View File

@ -25,13 +25,13 @@ def test_strategy_test_v3(dataframe_1m, fee, is_short, side):
strategy = StrategyTestV3({})
metadata = {'pair': 'ETH/BTC'}
assert type(strategy.minimal_roi) is dict
assert type(strategy.stoploss) is float
assert type(strategy.timeframe) is str
assert isinstance(strategy.minimal_roi, dict)
assert isinstance(strategy.stoploss, float)
assert isinstance(strategy.timeframe, str)
indicators = strategy.populate_indicators(dataframe_1m, metadata)
assert type(indicators) is DataFrame
assert type(strategy.populate_buy_trend(indicators, metadata)) is DataFrame
assert type(strategy.populate_sell_trend(indicators, metadata)) is DataFrame
assert isinstance(indicators, DataFrame)
assert isinstance(strategy.populate_buy_trend(indicators, metadata), DataFrame)
assert isinstance(strategy.populate_sell_trend(indicators, metadata), DataFrame)
trade = Trade(
open_rate=19_000,

View File

@ -63,7 +63,7 @@ def test_format_ms_time() -> None:
# Date 2018-04-10 18:02:01
date_in_epoch_ms = 1523383321000
date = format_ms_time(date_in_epoch_ms)
assert type(date) is str
assert isinstance(date, str)
res = datetime(2018, 4, 10, 18, 2, 1, tzinfo=timezone.utc)
assert date == res.astimezone(None).strftime('%Y-%m-%dT%H:%M:%S')
res = datetime(2017, 12, 13, 8, 2, 1, tzinfo=timezone.utc)