def METHOD_NAME(integration_cache, datafiles, element_name):
    project = str(datafiles)
    # Spawn interactive session using `configured()` context manager in order
    # to get the same config file as the `cli` fixture.
    with runcli.configured(project, config={"sourcedir": integration_cache.sources}) as config_file:
        session = pexpect.spawn(
            "bst",
            [
                "--directory",
                project,
                "--config",
                config_file,
                "--no-colors",
                "build",
                element_name,
            ],
            timeout=PEXPECT_TIMEOUT_SHORT,
        )
        yield session