Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/3666.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix test failures on v6 from hypothesis upgrade
13 changes: 8 additions & 5 deletions tests/core/filtering/test_contract_data_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest_asyncio

from tests.core.filtering.utils import (
MAX_UINT_256,
_async_emitter_fixture_logic,
_async_w3_fixture_logic,
_emitter_fixture_logic,
Expand Down Expand Up @@ -39,14 +40,16 @@ def dynamic_values(draw):

@st.composite
def fixed_values(draw):
non_matching_1 = draw(st.integers(min_value=0))
non_matching_2 = draw(st.integers(min_value=0))
non_matching_3 = draw(st.integers(min_value=0))
non_matching_4 = draw(st.integers(min_value=0))
non_matching_1 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_2 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_3 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_4 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
exclusions = (non_matching_1, non_matching_2, non_matching_3, non_matching_4)
matching_values = draw(
st.lists(
elements=st.integers(min_value=0).filter(lambda x: x not in exclusions),
elements=st.integers(min_value=0, max_value=MAX_UINT_256).filter(
lambda x: x not in exclusions
),
min_size=4,
max_size=4,
)
Expand Down
13 changes: 8 additions & 5 deletions tests/core/filtering/test_contract_topic_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest_asyncio

from tests.core.filtering.utils import (
MAX_UINT_256,
_async_emitter_fixture_logic,
_async_w3_fixture_logic,
_emitter_fixture_logic,
Expand Down Expand Up @@ -39,14 +40,16 @@ def dynamic_values(draw):

@st.composite
def fixed_values(draw):
non_matching_1 = draw(st.integers(min_value=0))
non_matching_2 = draw(st.integers(min_value=0))
non_matching_3 = draw(st.integers(min_value=0))
non_matching_4 = draw(st.integers(min_value=0))
non_matching_1 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_2 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_3 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
non_matching_4 = draw(st.integers(min_value=0, max_value=MAX_UINT_256))
exclusions = (non_matching_1, non_matching_2, non_matching_3, non_matching_4)
matching_values = draw(
st.lists(
elements=st.integers(min_value=0).filter(lambda x: x not in exclusions),
elements=st.integers(min_value=0, max_value=MAX_UINT_256).filter(
lambda x: x not in exclusions
),
min_size=4,
max_size=4,
)
Expand Down
2 changes: 2 additions & 0 deletions tests/core/filtering/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
EthereumTesterProvider,
)

MAX_UINT_256 = 2**256 - 1


def _w3_fixture_logic(request):
use_filter_middleware = request.param
Expand Down