@@ -53,7 +53,7 @@ def test_urlparse_valid_ipv4():
5353def test_urlparse_invalid_ipv4 ():
5454 with pytest .raises (httpx .InvalidURL ) as exc :
5555 httpx .URL ("https://999.999.999.999/" )
56- assert str (exc .value ) == "Invalid IPv4 address"
56+ assert str (exc .value ) == "Invalid IPv4 address: '999.999.999.999' "
5757
5858
5959def test_urlparse_valid_ipv6 ():
@@ -64,7 +64,7 @@ def test_urlparse_valid_ipv6():
6464def test_urlparse_invalid_ipv6 ():
6565 with pytest .raises (httpx .InvalidURL ) as exc :
6666 httpx .URL ("https://[2001]/" )
67- assert str (exc .value ) == "Invalid IPv6 address"
67+ assert str (exc .value ) == "Invalid IPv6 address: '[2001]' "
6868
6969
7070def test_urlparse_unescaped_idna_host ():
@@ -80,7 +80,7 @@ def test_urlparse_escaped_idna_host():
8080def test_urlparse_invalid_idna_host ():
8181 with pytest .raises (httpx .InvalidURL ) as exc :
8282 httpx .URL ("https://☃.com/" )
83- assert str (exc .value ) == "Invalid IDNA hostname"
83+ assert str (exc .value ) == "Invalid IDNA hostname: '☃.com' "
8484
8585
8686# Tests for different port types
@@ -100,7 +100,7 @@ def test_urlparse_normalized_port():
100100def test_urlparse_invalid_port ():
101101 with pytest .raises (httpx .InvalidURL ) as exc :
102102 httpx .URL ("https://example.com:abc/" )
103- assert str (exc .value ) == "Invalid port"
103+ assert str (exc .value ) == "Invalid port: 'abc' "
104104
105105
106106# Tests for path handling
0 commit comments