Skip to content

Commit 990c3f1

Browse files
committed
work around pytest on windows not liking long test ids
1 parent d1dae99 commit 990c3f1

File tree

1 file changed

+98
-21
lines changed

1 file changed

+98
-21
lines changed

tests/unit/common/vector/test_vector.py

Lines changed: 98 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -275,37 +275,114 @@ def test_swap_endian_unhandled_size(mocker, ext, type_size):
275275
@pytest.mark.parametrize(
276276
("dtype", "data"),
277277
(
278-
("i8", b""),
279-
("i8", b"\x01"),
280-
("i8", b"\x01\x02\x03\x04"),
281-
("i8", _max_value_be_bytes(1, 4096)),
282-
("i16", b""),
283-
("i16", b"\x00\x01"),
284-
("i16", b"\x00\x01\x00\x02"),
285-
("i16", _max_value_be_bytes(2, 4096)),
286-
("i32", b""),
287-
("i32", b"\x00\x00\x00\x01"),
288-
("i32", b"\x00\x00\x00\x01\x00\x00\x00\x02"),
289-
("i32", _max_value_be_bytes(4, 4096)),
290-
("i64", b""),
291-
("i64", b"\x00\x00\x00\x00\x00\x00\x00\x01"),
292-
(
278+
pytest.param(
279+
"i8",
280+
b"",
281+
id="i8-empty",
282+
),
283+
pytest.param(
284+
"i8",
285+
b"\x01",
286+
id="i8-single",
287+
),
288+
pytest.param(
289+
"i8",
290+
b"\x01\x02\x03\x04",
291+
id="i8-some",
292+
),
293+
pytest.param(
294+
"i8",
295+
_max_value_be_bytes(1, 4096),
296+
id="i8-limit",
297+
),
298+
pytest.param(
299+
"i16",
300+
b"",
301+
id="i16-empty",
302+
),
303+
pytest.param(
304+
"i16",
305+
b"\x00\x01",
306+
id="i16-single",
307+
),
308+
pytest.param(
309+
"i16",
310+
b"\x00\x01\x00\x02",
311+
id="i16-some",
312+
),
313+
pytest.param(
314+
"i16",
315+
_max_value_be_bytes(2, 4096),
316+
id="i16-limit",
317+
),
318+
pytest.param(
319+
"i32",
320+
b"",
321+
id="i32-empty",
322+
),
323+
pytest.param(
324+
"i32",
325+
b"\x00\x00\x00\x01",
326+
id="i32-single",
327+
),
328+
pytest.param(
329+
"i32",
330+
b"\x00\x00\x00\x01\x00\x00\x00\x02",
331+
id="i32-some",
332+
),
333+
pytest.param(
334+
"i32",
335+
_max_value_be_bytes(4, 4096),
336+
id="i32-limit",
337+
),
338+
pytest.param(
339+
"i64",
340+
b"",
341+
id="i64-empty",
342+
),
343+
pytest.param(
344+
"i64",
345+
b"\x00\x00\x00\x00\x00\x00\x00\x01",
346+
id="i64-single",
347+
),
348+
pytest.param(
293349
"i64",
294350
(
295351
b"\x00\x00\x00\x00\x00\x00\x00\x01"
296352
b"\x00\x00\x00\x00\x00\x00\x00\x02"
297353
),
354+
id="i64-some",
355+
),
356+
pytest.param(
357+
"i64",
358+
_max_value_be_bytes(8, 4096),
359+
id="i64-limit",
360+
),
361+
pytest.param(
362+
"f32",
363+
b"",
364+
id="f32-empty",
365+
),
366+
pytest.param(
367+
"f32",
368+
_random_value_be_bytes(4, 4096),
369+
id="f32-limit",
370+
),
371+
pytest.param(
372+
"f64",
373+
b"",
374+
id="f64-empty",
375+
),
376+
pytest.param(
377+
"f64",
378+
_random_value_be_bytes(8, 4096),
379+
id="f64-limit",
298380
),
299-
("i64", _max_value_be_bytes(8, 4096)),
300-
("f32", b""),
301-
("f32", _random_value_be_bytes(4, 4096)),
302-
("f64", b""),
303-
("f64", _random_value_be_bytes(8, 4096)),
304381
),
305382
)
306383
@pytest.mark.parametrize("input_endian", (None, *ENDIAN_LITERALS))
307384
@pytest.mark.parametrize("as_bytearray", (False, True))
308-
def test_raw_data(
385+
def test_raw_data_limits(
309386
dtype: t.Literal["i8", "i16", "i32", "i64", "f32", "f64"],
310387
data: bytes,
311388
input_endian: T_ENDIAN_LITERAL | None,

0 commit comments

Comments
 (0)