def METHOD_NAME(capsys):
    """Test ProgressBar with parallel computing, advanced version."""
    assert capsys.readouterr().out == ""
    # This must be "1" because "capsys" won't get stdout properly otherwise
    parallel, p_fun, _ = parallel_func(_identity_block_wide, n_jobs=1, verbose=False)
    arr = np.arange(10)
    with use_log_level(True):
        with ProgressBar(len(arr) * 2) as pb:
            out = parallel(
                p_fun(x, pb.subset(pb_idx))
                for pb_idx, x in array_split_idx(arr, 2, n_per_split=2)
            )
            idxs = np.concatenate([o[1] for o in out])
            assert_array_equal(idxs, np.arange(len(arr) * 2))
            out = np.concatenate([o[0] for o in out])
            assert Path(pb._mmap_fname).is_file()
            sum_ = np.memmap(
                pb._mmap_fname, dtype="bool", mode="r", shape=len(arr) * 2
            ).sum()
            assert sum_ == len(arr) * 2
    assert not Path(pb._mmap_fname).is_file(), "__exit__ not called?"
    cap = capsys.readouterr()
    out = cap.err
    assert "100%" in out