Fix random test failure (2nd try)

This commit is contained in:
Matthias 2022-02-26 17:08:35 +01:00
parent 79ddc9abaa
commit e9f3f3d859

View File

@ -613,12 +613,9 @@ def test_api_trade_single(botclient, mocker, fee, ticker, markets, is_short):
assert_response(rc, 404)
assert rc.json()['detail'] == 'Trade not found.'
Trade.query.session.rollback()
create_mock_trades(fee, is_short=is_short)
# The below line avoids random test failures.
# It's unclear why.
assert len(Trade.get_trades().all()) > 1
rc = client_get(client, f"{BASE_URI}/trade/3")
assert_response(rc)
assert rc.json()['trade_id'] == 3