def mock_endpoint_factory(mock_endpoint):
    """
    Fixture that yields a factory function used to create a USB endpoint at the given address.
    """
    def factory(address):
        mock_endpoint.getAddress.return_value = address
        return mock_endpoint

    return factory