massdash.testing.NumpySnapshotExtension

class massdash.testing.NumpySnapshotExtension

Bases: SingleFileSnapshotExtension

Handles Numpy Snapshots. Snapshots are stored as raw files and the numpy arrays are compared using numpy testing methods.

matches(*, serialized_data, snapshot_data)

Compares serialized data and snapshot data and returns whether they match.

serialize(data: Any, **kwargs: Any) bytes

Serializes a python object / data structure into a string to be used for comparison with snapshot data from disk.