@pytest.fixture
def capture_controller():
 capture_controller = create_capture_controller()
 setup_capture_controller(capture_controller)
 (yield capture_controller)
 capture_controller.teardown_capture()

@ pytest . fixture def capture_controller ( ) : capture_controller = create_capture_controller ( ) setup_capture_controller ( capture_controller ) ( yield capture_controller ) capture_controller . teardown_capture ( )
provides a capture_controller that is already setup and automatically performs a teardown afterwards .