Skip to content

Commit 0e73be8

Browse files
Deprecate URL.is_ssl (#1128)
1 parent 3205536 commit 0e73be8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

httpx/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def raw(self) -> typing.Tuple[bytes, bytes, typing.Optional[int], bytes]:
140140

141141
@property
142142
def is_ssl(self) -> bool:
143+
message = 'URL.is_ssl() is pending deprecation. Use url.scheme == "https"'
144+
warnings.warn(message, DeprecationWarning)
143145
return self.scheme == "https"
144146

145147
@property

tests/client/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ def test_merge_absolute_url():
178178
client = httpx.Client(base_url="https://www.example.com/")
179179
request = client.build_request("GET", "http://www.example.com/")
180180
assert request.url == httpx.URL("http://www.example.com/")
181-
assert not request.url.is_ssl
181+
with pytest.warns(DeprecationWarning):
182+
assert not request.url.is_ssl
182183

183184

184185
def test_merge_relative_url():

0 commit comments

Comments
 (0)