MCPcopy Create free account
hub / github.com/apache/fory / test_array_serializer

Function test_array_serializer

python/pyfory/tests/test_serializer.py:570–580  ·  view source on GitHub ↗
(xlang)

Source from the content-addressed store, hash-verified

568
569@pytest.mark.parametrize("xlang", [True, False])
570def test_array_serializer(xlang):
571 fory = Fory(xlang=xlang, ref=True, strict=False, compatible=xlang)
572 for typecode in PyArraySerializer.typecode_dict.keys():
573 arr = array.array(typecode, list(range(10)))
574 new_arr = ser_de(fory, arr)
575 assert np.array_equal(new_arr, arr)
576 for dtype in Numpy1DArraySerializer.dtypes_dict.keys():
577 arr = np.array(list(range(10)), dtype=dtype)
578 new_arr = ser_de(fory, arr)
579 assert np.array_equal(new_arr, arr)
580 np.testing.assert_array_equal(new_arr, arr)
581
582
583def test_numpy_array_memoryview():

Callers

nothing calls this directly

Calls 5

ForyClass · 0.90
ser_deFunction · 0.70
listFunction · 0.50
keysMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected