Skip to content

Commit bb28794

Browse files
committed
tweak large benchmark ordering
1 parent 24965d7 commit bb28794

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/benchmarks/test_micro_benchmarks.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,25 @@ class CoreModel:
159159
}
160160
)
161161

162-
data = {f'field_{i}': i for i in range(98)}
162+
data = {f'field_{97 - i}': i for i in range(98)}
163163
data['more'] = 'more data'
164164

165165
@pytest.mark.benchmark(group='large model - python')
166166
def test_core_python(self, core_model_validator, benchmark):
167167
m = core_model_validator.validate_python(self.data)
168-
assert m.field_0 == 0
169-
assert m.field_1 == 1
168+
assert m.field_0 == 97
169+
assert m.field_1 == 96
170+
assert m.field_97 == 0
170171
assert m.more == 'more data'
171172
benchmark(core_model_validator.validate_python, self.data)
172173

173174
@pytest.mark.benchmark(group='large model - JSON')
174175
def test_core_json_fs(self, core_model_validator, benchmark):
175176
json_data = json.dumps(self.data)
176177
m = core_model_validator.validate_json(json_data)
177-
assert m.field_0 == 0
178-
assert m.field_1 == 1
178+
assert m.field_0 == 97
179+
assert m.field_1 == 96
180+
assert m.field_97 == 0
179181
assert m.more == 'more data'
180182
benchmark(core_model_validator.validate_json, json_data)
181183

0 commit comments

Comments
 (0)