def METHOD_NAME(capsys):
    """
    If some inner context manager fails at __enter__,
    our composer should bubble the error to the outside world.
    """
    with pytest.raises(ZeroDivisionError):
        a = _context_manager_gen("a", will_catch=True)
        b = _context_manager_gen("b")
        c = _context_manager_gen("c", will_raise=True)
        d = _context_manager_gen("d")
        with compose_contexts(a(), b(), c(), d()) as rs:
            assert rs == NotImplemented
            raise NotImplementedError("this will never be executed")
    expected = (
        [f"entering {n}" for n in ("a", "b", "c")]
        + ["raised by c"]
        + [f"leaving {n}" for n in ("b", "a")]
    )
    captured = capsys.readouterr().out.strip().split("\n")
    assert captured == expected