]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Rename 'next' to 'anext' on Response (#676)
authorFlorimond Manca <florimond.manca@gmail.com>
Sun, 29 Dec 2019 15:34:07 +0000 (16:34 +0100)
committerTom Christie <tom@tomchristie.com>
Sun, 29 Dec 2019 15:34:07 +0000 (15:34 +0000)
* Rename 'next' to 'anext' on Response

* Drop iscoroutinefunction() check

Co-authored-by: Tom Christie <tom@tomchristie.com>
docs/api.md
httpx/models.py
tests/client/test_redirects.py

index 06126b00d0aba7fee56e6d78d9404231da4fa6fe..3b28fb3828fccb016cc52f03d5e2e538d68ac14d 100644 (file)
@@ -68,7 +68,7 @@
 * `def .aiter_text()` - **async text iterator**
 * `def .aiter_lines()` - **async text iterator**
 * `def .aclose()` - **None**
-* `def .next()` - **Response**
+* `def .anext()` - **Response**
 
 ## `Request`
 
index 174109511fbe8c983ba6a2ddd560b866f0f6e086..8b219d326e39ebb703b7f5e28628002918632f95 100644 (file)
@@ -916,7 +916,7 @@ class Response:
                 yield part
             await self.aclose()
 
-    async def next(self) -> "Response":
+    async def anext(self) -> "Response":
         """
         Get the next response from a redirect response.
         """
index 492098889e1565e3b1ee45b0eb81f60a8f9fa4ba..8ad81fee3897444d97049f991d969edf056a4e59 100644 (file)
@@ -110,7 +110,7 @@ async def test_no_redirect():
     response = await client.get(url)
     assert response.status_code == 200
     with pytest.raises(NotRedirectResponse):
-        await response.next()
+        await response.anext()
 
 
 @pytest.mark.usefixtures("async_environment")
@@ -151,7 +151,7 @@ async def test_disallow_redirects():
     assert response.is_redirect is True
     assert len(response.history) == 0
 
-    response = await response.next()
+    response = await response.anext()
     assert response.status_code == codes.OK
     assert response.url == URL("https://example.org/")
     assert response.is_redirect is False
@@ -216,7 +216,7 @@ async def test_too_many_redirects_calling_next():
     response = await client.get(url, allow_redirects=False)
     with pytest.raises(TooManyRedirects):
         while response.is_redirect:
-            response = await response.next()
+            response = await response.anext()
 
 
 @pytest.mark.usefixtures("async_environment")
@@ -233,7 +233,7 @@ async def test_redirect_loop_calling_next():
     response = await client.get(url, allow_redirects=False)
     with pytest.raises(RedirectLoop):
         while response.is_redirect:
-            response = await response.next()
+            response = await response.anext()
 
 
 @pytest.mark.usefixtures("async_environment")