Skip to content

Commit

Permalink
Expanding failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
poliwop committed Jun 29, 2023
1 parent 878a246 commit 58b4b49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hydradx/tests/test_omnipool_agents.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy

import pytest
from hypothesis import given, strategies as st # , settings
from hypothesis import given, strategies as st, settings # , settings

# from hydradx.model import run
from hydradx.model.amm import omnipool_amm as oamm
Expand Down Expand Up @@ -96,6 +96,7 @@ def test_omnipool_arbitrager_feeless(omnipool: oamm.OmnipoolState, market: list,
raise


@settings(max_examples=10000)
@given(omnipool_reasonable_config(token_count=3), reasonable_market(token_count=3), arb_precision_strategy)
def test_omnipool_arbitrager(omnipool: oamm.OmnipoolState, market: list, arb_precision: int):
omnipool.trade_limit_per_block = float('inf')
Expand Down Expand Up @@ -130,7 +131,7 @@ def test_omnipool_arbitrager(omnipool: oamm.OmnipoolState, market: list, arb_pre
# Trading should be profitable
if old_value > new_value:
if new_value != pytest.approx(old_value, rel=1e-15):
raise
raise ValueError(f'Failed to make profit: {old_value} -> {new_value}')


@given(omnipool_reasonable_config(token_count=3))
Expand Down

0 comments on commit 58b4b49

Please sign in to comment.