total_open_trades_stake should support no-db mode

This commit is contained in:
Matthias
2021-02-10 19:33:39 +01:00
parent 0faa6f84dc
commit 0754a7a78f
4 changed files with 30 additions and 12 deletions

View File

@@ -1039,14 +1039,18 @@ def test_fee_updated(fee):
@pytest.mark.usefixtures("init_persistence")
def test_total_open_trades_stakes(fee):
@pytest.mark.parametrize('use_db', [True, False])
def test_total_open_trades_stakes(fee, use_db):
Trade.use_db = use_db
res = Trade.total_open_trades_stakes()
assert res == 0
create_mock_trades(fee)
create_mock_trades(fee, use_db)
res = Trade.total_open_trades_stakes()
assert res == 0.004
Trade.use_db = True
@pytest.mark.usefixtures("init_persistence")
def test_get_overall_performance(fee):