(server)
| 132 | |
| 133 | |
| 134 | def test_raise_for_status(server): |
| 135 | with httpx.Client() as client: |
| 136 | for status_code in (200, 400, 404, 500, 505): |
| 137 | response = client.request( |
| 138 | "GET", server.url.copy_with(path=f"/status/{status_code}") |
| 139 | ) |
| 140 | if 400 <= status_code < 600: |
| 141 | with pytest.raises(httpx.HTTPStatusError) as exc_info: |
| 142 | response.raise_for_status() |
| 143 | assert exc_info.value.response == response |
| 144 | assert exc_info.value.request.url.path == f"/status/{status_code}" |
| 145 | else: |
| 146 | assert response.raise_for_status() is response |
| 147 | |
| 148 | |
| 149 | def test_options(server): |
nothing calls this directly
no test coverage detected