Issue2987 - Added additional Invalid URL and changed the Invalid URL checking code for better.
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 4085de7..c25b6e0 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -272,6 +272,7 @@
for invalid_url in [
'http://::12.34.56.78]/',
'http://[::1/foo/',
+ 'http://[::1/foo/bad]/bad',
'http://[::ffff:12.34.56.78']:
self.assertRaises(ValueError, lambda : urlparse.urlparse(invalid_url).hostname)
self.assertRaises(ValueError, lambda : urlparse.urlparse(invalid_url))