def test_pipe_label_data_no_labels(pipe): nlp = Language() pipe = nlp.add_pipe(pipe) assert getattr(pipe, "label_data", None) is None initialize = getattr(pipe, "initialize", None) if initialize is not None: assert "labels" not in get_arg_names(initialize)
def test_pipe_label_data_exports_labels(pipe): nlp = Language() pipe = nlp.add_pipe(pipe) # Make sure pipe has pipe labels assert getattr(pipe, "label_data", None) is not None # Make sure pipe can be initialized with labels initialize = getattr(pipe, "initialize", None) assert initialize is not None assert "labels" in get_arg_names(initialize)