Factor out tests for X_labels and y_labels
Override _check_labels in HDF5Dataset