def METHOD_NAME(cognite_client):
    testid = random_string(50)
    dataset = cognite_client.data_sets.list()[0]
    extpipe = cognite_client.extraction_pipelines.create(
        ExtractionPipeline(
            external_id=f"testid-{testid}",
            name=f"Test extpipe {testid}",
            data_set_id=dataset.id,
            description="Short description",
            contacts=[
                ExtractionPipelineContact(
                    name="John Doe", email="john.doe@cognite.com", role="owner", send_notification=False
                )
            ],
            schedule="Continuous",
        )
    )
    yield extpipe
    try:
        cognite_client.extraction_pipelines.delete(id=extpipe.id)
    except Exception:
        pass
    assert cognite_client.extraction_pipelines.retrieve(extpipe.id) is None