diff options
author | Quentin Pradet <quentin.pradet@gmail.com> | 2022-11-17 17:43:26 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 07:43:26 -0600 |
commit | 19582a1f35ae810f97dc46897232770c810c197a (patch) | |
tree | 366d1e9579679b3522acc4353ba811ba49881ab6 /test/test_response.py | |
parent | 02e62247fde7bff4729bd6495ca4b5fe0fe1c239 (diff) | |
download | urllib3-19582a1f35ae810f97dc46897232770c810c197a.tar.gz |
Restore but deprecate HTTPResponse.getheaders() and .getheader() methods
Diffstat (limited to 'test/test_response.py')
-rw-r--r-- | test/test_response.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test_response.py b/test/test_response.py index 38218f40..e7ffe889 100644 --- a/test/test_response.py +++ b/test/test_response.py @@ -112,12 +112,20 @@ class TestLegacyResponse: def test_getheaders(self) -> None: headers = {"host": "example.com"} r = HTTPResponse(headers=headers) - assert r.getheaders() == [("host", "example.com")] + with pytest.warns( + DeprecationWarning, + match=r"HTTPResponse.getheaders\(\) is deprecated", + ): + assert r.getheaders() == [("host", "example.com")] def test_getheader(self) -> None: headers = {"host": "example.com"} r = HTTPResponse(headers=headers) - assert r.getheader("host") == "example.com" + with pytest.warns( + DeprecationWarning, + match=r"HTTPResponse.getheader\(\) is deprecated", + ): + assert r.getheader("host") == "example.com" class TestResponse: |