Skip to content

Commit

Permalink
test: limit number of run test_should_raise_when_bytes_len_is_not_min…
Browse files Browse the repository at this point in the history
…imal
  • Loading branch information
obatirou committed Aug 1, 2024
1 parent d88ca38 commit 37dd76b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/src/utils/test_bytes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import pytest
from hypothesis import given
from hypothesis import given, settings
from hypothesis.strategies import integers

from tests.utils.errors import cairo_error
Expand Down Expand Up @@ -53,6 +53,7 @@ def test_should_raise_when_byte_value_not_modulo_base(
# This test checks the function fails if the first bytes is replaced by 0
# All values that have 0 as first bytes will not raise an error
# The value 0 is also excluded as it is treated as a special case in the function
# THere is a max_examples as without it it fills up the memory and run forever in CI
@given(
n=integers(min_value=1, max_value=2**248 - 1).filter(
lambda x: int.to_bytes(
Expand All @@ -61,6 +62,7 @@ def test_should_raise_when_byte_value_not_modulo_base(
!= 0
)
)
@settings(max_examples=50)
def test_should_raise_when_bytes_len_is_not_minimal(
self, cairo_program, cairo_run, n
):
Expand Down

0 comments on commit 37dd76b

Please sign in to comment.