Skip to content

Commit a70ca0f

Browse files
committed
fix: grouping
1 parent 63da35b commit a70ca0f

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

tests/benchmarks/complete_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def input_data_lax():
262262
'field_tuple_var_len_float': tuple(i + 0.5 for i in range(100)),
263263
'field_tuple_var_len_float_con': tuple(i + 0.5 for i in range(42)),
264264
'field_tuple_fix_len': ('a', 1, 1.0, True),
265-
'field_dict_any': {'a': 'b', 1: True, 1.0: 1.0}, # noqa: F601
265+
'field_dict_any': {'a': 'b', 1: True, 1.0: 1.0},
266266
'field_dict_str_float': {f'{i}': i + 0.5 for i in range(100)},
267267
'field_literal_1_int': 1,
268268
'field_literal_1_str': 'foobar',

tests/benchmarks/test_complete_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_complete_valid():
5353
'field_tuple_var_len_float': tuple(i + 0.5 for i in range(100)),
5454
'field_tuple_var_len_float_con': tuple(i + 0.5 for i in range(42)),
5555
'field_tuple_fix_len': ('a', 1, 1.0, True),
56-
'field_dict_any': {'a': 'b', 1: True, 1.0: 1.0}, # noqa: F601
56+
'field_dict_any': {'a': 'b', 1: True, 1.0: 1.0},
5757
'field_dict_str_float': {f'{i}': i + 0.5 for i in range(100)},
5858
'field_literal_1_int': 1,
5959
'field_literal_1_str': 'foobar',

tests/benchmarks/test_serialization_micro.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def r():
319319
fs_model_serializer.to_python(m, exclude_unset=True)
320320

321321

322+
@pytest.mark.benchmark(group='model-list-json')
322323
def test_model_list_core_json(benchmark):
323324
s = SchemaSerializer(
324325
core_schema.model_schema(
@@ -348,7 +349,7 @@ def r():
348349
s.to_json(m_big)
349350

350351

351-
@pytest.mark.benchmark(group='model-list-json')
352+
@pytest.mark.benchmark(group='temporal')
352353
def test_datetime(benchmark):
353354
v = SchemaSerializer(core_schema.datetime_schema())
354355
d = datetime(2022, 12, 2, 12, 13, 14)
@@ -359,7 +360,7 @@ def r():
359360
v.to_python(d, mode='json')
360361

361362

362-
@pytest.mark.benchmark(group='model-list-json')
363+
@pytest.mark.benchmark(group='temporal')
363364
def test_datetime_seconds(benchmark):
364365
v = SchemaSerializer(
365366
core_schema.datetime_schema(),
@@ -375,7 +376,7 @@ def r():
375376
v.to_python(d, mode='json')
376377

377378

378-
@pytest.mark.benchmark(group='model-list-json')
379+
@pytest.mark.benchmark(group='temporal')
379380
def test_datetime_milliseconds(benchmark):
380381
v = SchemaSerializer(core_schema.datetime_schema(), config={'ser_json_temporal': 'milliseconds'})
381382
d = datetime(2022, 12, 2, 12, 13, 14)

tests/test_misc.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ def get_type_value(schema_typeddict) -> str:
169169
inspected_ann = inspect_annotation(annotation, annotation_source=AnnotationSource.TYPED_DICT)
170170
annotation = inspected_ann.type
171171
assert annotation is not UNKNOWN
172-
assert typing_objects.is_literal(get_origin(annotation)), (
173-
f"The 'type' key of core schemas must be a Literal form, got {get_origin(annotation)}"
174-
)
172+
assert typing_objects.is_literal(
173+
get_origin(annotation)
174+
), f"The 'type' key of core schemas must be a Literal form, got {get_origin(annotation)}"
175175
args = get_args(annotation)
176-
assert len(args) == 1, (
177-
f"The 'type' key of core schemas must be a Literal form with a single element, got {len(args)} elements"
178-
)
176+
assert (
177+
len(args) == 1
178+
), f"The 'type' key of core schemas must be a Literal form with a single element, got {len(args)} elements"
179179
type_ = args[0]
180-
assert isinstance(type_, str), (
181-
f"The 'type' key of core schemas must be a Literal form with a single string element, got element of type {type(type_)}"
182-
)
180+
assert isinstance(
181+
type_, str
182+
), f"The 'type' key of core schemas must be a Literal form with a single string element, got element of type {type(type_)}"
183183

184184
return type_
185185

0 commit comments

Comments
 (0)