Skip to content

Commit 900df9d

Browse files
committed
add benchmark for set with length check
1 parent 1ab812e commit 900df9d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/benchmarks/test_micro_benchmarks.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,16 @@ def t():
511511
v.validate_python(set_of_ints_duplicates[1])
512512

513513

514+
@pytest.mark.benchmark(group='Set[int]')
515+
def test_set_of_ints_core_length(benchmark):
516+
v = SchemaValidator({'type': 'set', 'items_schema': {'type': 'int'}, 'max_length': 2000})
517+
518+
@benchmark
519+
def t():
520+
v.validate_python(set_of_ints_data[0])
521+
v.validate_python(set_of_ints_data[1])
522+
523+
514524
@skip_pydantic
515525
@pytest.mark.benchmark(group='Set[int] JSON')
516526
def test_set_of_ints_pyd_json(benchmark):

0 commit comments

Comments
 (0)