

def compare(self, vf, version):
    if (LooseVersion(result) < '0.18.0'):
        data = read_msgpack(vf, encoding='latin-1')
    else:
        data = read_msgpack(vf)
    self.check_min_structure(data)
    for (typ, dv) in data.items():
        assert (typ in self.all_data), 'unpacked data contains extra key "{0}"'.format(typ)
        for (dt, result) in dv.items():
            assert (dt in self.all_data[typ]), 'data["{0}"] contains extra key "{1}"'.format(typ, dt)
            try:
                expected = self.data[typ][dt]
            except KeyError:
                continue
            comparator = getattr(self, 'compare_{typ}_{dt}'.format(typ=typ, dt=dt), None)
            if (comparator is not None):
                comparator(result, expected, typ, version)
            else:
                check_arbitrary(result, expected)
    return data

dataset/ETHPy150Open pydata/pandas/pandas/io/tests/test_packers.py TestMsgpack.compare/VarMisuse@18/21 `version`->`result`