nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: encode/httpx
Pull request #676 (2019-12-21 17:05:50)

Rename 'next' to 'anext' on Response
Refs #667 


Patch:
diff --git a/docs/api.md b/docs/api.md
index 06126b0..3b28fb3 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -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`
 
diff --git a/httpx/models.py b/httpx/models.py
index 1741095..8b219d3 100644
--- a/httpx/models.py
+++ b/httpx/models.py
@@ -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.
         """


Test patch:
diff --git a/tests/client/test_redirects.py b/tests/client/test_redirects.py
index 4920988..8ad81fe 100644
--- a/tests/client/test_redirects.py
+++ b/tests/client/test_redirects.py
@@ -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")