Skip to content

Commit 36fc5eb

Browse files
committed
Allow a character for a minus sign in Float field
1 parent ff9d8fa commit 36fc5eb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/hypothesis_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ def test_shx_reader_writer_roundtrip(codes_and_shapes)-> None:
528528
DBF_FIELD_TYPES = {
529529
"C": {},
530530
"N": {"max_decimal" : 20, "max_length": 22}, # max length=23 to avoid error due to precision limit, e.g.:
531-
"F": {"max_decimal" : 20, "max_length": 22}, # hypothesis.errors.InvalidArgument: max_value=100000000000000000000000
532-
# cannot be exactly represented as a float of
531+
"F": {"max_decimal" : 20, "max_length": 22}, # hypothesis.errors.InvalidArgument: max_value=100000000000000000000000
532+
# cannot be exactly represented as a float of
533533
# width 64 - use max_value=1e+23 instead.
534534
"L": {"max_length": 1},
535535
"D": {"min_length": 8, "max_length": 8},
@@ -551,7 +551,7 @@ def dbf_field(draw):
551551
min_length = bounds_dict.get("min_length", 1)
552552
max_decimal = bounds_dict.get("max_decimal", 0)
553553
size = draw(integers(min_value=min_length, max_value=max_length))
554-
decimal = draw(integers(min_value=0, max_value=max(0,min(size - 2, max_decimal))))
554+
decimal = draw(integers(min_value=0, max_value=max(0,min(size - 3, max_decimal))))
555555

556556

557557
return {"name": name, "field_type": field_type, "size": size, "decimal": decimal}

0 commit comments

Comments
 (0)