'Test InvalidUrlError.
Args:
url: The URL to pass to InvalidUrlError.
raising; True if the InvalidUrlError should raise itself.
has_err_string: Whether the QUrl is expected to have errorString
set.'

@pytest.mark.parametrize('url,    raising,    has_err_string', [(QUrl(), False, False), (QUrl('http://www.example.com/'), True, False), (QUrl('://'), False, True)])
def test_invalid_url_error(self, url, raising, has_err_string):

    if raising:
        expected_exc = ValueError
    else:
        expected_exc = urlutils.InvalidUrlError
    with pytest.raises(expected_exc) as excinfo:
        raise urlutils.InvalidUrlError(url)
    if (not raising):
        expected_text = 'Invalid    URL'
        if has_err_string:
            expected_text += ('    -    ' + url.errorString())
        assert (str(excinfo.value) == expected_text)
