def cleanup_build_pods(request):
    """Cleanup running build pods at the beginning and end of a session."""
    if not K8S_AVAILABLE:
        return

    def cleanup():
        return cleanup_pods({"component": "binderhub-build"})

    cleanup()
    request.addfinalizer(cleanup)
Cleanup running build pods at the beginning and end of a session.
binderhub/tests/conftest.py