@pytest.mark.parametrize(('acquire', 'use', 'release', 'final_result', 'log'), [(_acquire_success, _use_success, _ReleaseSuccess, IOSuccess('use success'), [('acquire success', Success('use success'))]), (_acquire_success, _use_success, _ReleaseFailure, IOFailure('release failure'), []), (_acquire_success, _use_failure, _ReleaseSuccess, IOFailure('use failure'), [('acquire success', Failure('use failure'))]), (_acquire_success, _use_failure, _ReleaseFailure, IOFailure('release failure'), []), (_acquire_failure, _use_success, _ReleaseSuccess, IOFailure('acquire failure'), []), (_acquire_failure, _use_failure, _ReleaseSuccess, IOFailure('acquire failure'), []), (_acquire_failure, _use_success, _ReleaseFailure, IOFailure('acquire failure'), []), (_acquire_failure, _use_failure, _ReleaseFailure, IOFailure('acquire failure'), [])])
def test_all_success(acquire, use, release, final_result, log):
    'Ensures that managed works as intended.'
    pipeline_logs: List[Tuple[(str, Result[(str, str)])]] = []
    pipeline_result = managed(use, release(pipeline_logs))(acquire)
    assert (pipeline_result == final_result)
    assert (pipeline_logs == log)
Ensures that managed works as intended.
@pytest.mark.parametrize(('acquire', 'use', 'release', 'final_result', 'log'), [(_acquire_success, _use_success, _ReleaseSuccess, IOSuccess('use success'), [('acquire success', Success('use success'))]), (_acquire_success, _use_success, _ReleaseFailure, IOFailure('release failure'), []), (_acquire_success, _use_failure, _ReleaseSuccess, IOFailure('use failure'), [('acquire success', Failure('use failure'))]), (_acquire_success, _use_failure, _ReleaseFailure, IOFailure('release failure'), []), (_acquire_failure, _use_success, _ReleaseSuccess, IOFailure('acquire failure'), []), (_acquire_failure, _use_failure, _ReleaseSuccess, IOFailure('acquire failure'), []), (_acquire_failure, _use_success, _ReleaseFailure, IOFailure('acquire failure'), []), (_acquire_failure, _use_failure, _ReleaseFailure, IOFailure('acquire failure'), [])])
def test_all_success(acquire, use, release, final_result, log):
    
    pipeline_logs: List[Tuple[(str, Result[(str, str)])]] = []
    pipeline_result = managed(use, release(pipeline_logs))(acquire)
    assert (pipeline_result == final_result)
    assert (pipeline_logs == log)