@contextlib.contextmanager<EOL>def _install_capture_fixture_on_item(request, capture_class):
request.node._capture_fixture = fixture = CaptureFixture(capture_class, request)<EOL>capmanager = request.config.pluginmanager.getplugin("<STR_LIT>")<EOL>capmanager.activate_fixture(request.node)<EOL>yield fixture<EOL>fixture.close()<EOL>del request.node._capture_fixture<EOL>
Context manager which creates a ``CaptureFixture`` instance and "installs" it on
the item/node of the given request. Used by ``capsys`` and ``capfd``.

The CaptureFixture is added as attribute of the item because it needs to accessed
by ``CaptureManager`` during its ``pytest_runtest_*`` hooks.