def METHOD_NAME(capsys):
    """
    If all the __enter__ have passed and something fails inside our
    composed context, we should allow those individual context managers
    to handle it.
    """
    a = _context_manager_gen("a", will_catch=True)
    b = _context_manager_gen("b", will_catch=True)
    c = _context_manager_gen("c")
    d = _context_manager_gen("d")
    with compose_contexts(a(), b(), c(), d()) as rs:
        assert rs == ("ra", "rb", "rc", "rd")
        sys.stdout.write("raised by body\n")
        raise RuntimeError("haha")
    expected = (
        [f"entering {n}" for n in ("a", "b", "c", "d")]
        + ["raised by body", "leaving d", "leaving c", "caught by b"]
        + ["leaving b", "leaving a"]
    )
    captured = capsys.readouterr().out.strip().split("\n")
    assert captured == expected