]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Deprecate URL.is_ssl (#1128)
authorTom Christie <tom@tomchristie.com>
Wed, 5 Aug 2020 18:10:59 +0000 (19:10 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 18:10:59 +0000 (19:10 +0100)
httpx/_models.py
tests/client/test_client.py

index e89851529190c279ff398b1f5d1a83359d9fc9a6..2d75e8f542e4da0fcab7c8060d34aa0ec4c1fd72 100644 (file)
@@ -140,6 +140,8 @@ class URL:
 
     @property
     def is_ssl(self) -> bool:
+        message = 'URL.is_ssl() is pending deprecation. Use url.scheme == "https"'
+        warnings.warn(message, DeprecationWarning)
         return self.scheme == "https"
 
     @property
index b05735ea5e20812ec6797de84ad4e27520176d5e..03f3d788ed0f47bc98040af1d7c52317456fbfa9 100644 (file)
@@ -178,7 +178,8 @@ def test_merge_absolute_url():
     client = httpx.Client(base_url="https://www.example.com/")
     request = client.build_request("GET", "http://www.example.com/")
     assert request.url == httpx.URL("http://www.example.com/")
-    assert not request.url.is_ssl
+    with pytest.warns(DeprecationWarning):
+        assert not request.url.is_ssl
 
 
 def test_merge_relative_url():