You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Callbacks are now called with `ext` dictionary instead of `timeout`. To follow `httpcore` design changes. You can still retrieve timeout by using ```ext['timeout']```
13
+
9
14
## [0.8.0] - 2020-08-26
10
15
### Added
11
16
-`non_mocked_hosts` fixture allowing to avoid mocking requests sent on some specific hosts.
@@ -99,7 +104,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
104
### Added
100
105
- First release, should be considered as unstable for now as design might change.
Callback should return a httpcore response (as a tuple), you can use `pytest_httpx.to_response` function to create such a tuple.
355
+
Callback should return a `httpcore` response (as a tuple), you can use `pytest_httpx.to_response` function to create such a tuple.
356
356
357
357
```python
358
358
import httpx
@@ -386,8 +386,8 @@ from pytest_httpx import HTTPXMock
386
386
387
387
388
388
deftest_exception_raising(httpx_mock: HTTPXMock):
389
-
defraise_timeout(request, timeout):
390
-
raise httpx.ReadTimeout(f"Unable to read within {timeout}", request=request)
389
+
defraise_timeout(request, ext: dict):
390
+
raise httpx.ReadTimeout(f"Unable to read within {ext['timeout']}", request=request)
391
391
392
392
httpx_mock.add_callback(raise_timeout)
393
393
@@ -422,7 +422,7 @@ You can add criteria so that callback will be sent only in case of a more specif
422
422
423
423
#### Matching on URL
424
424
425
-
`url` parameter can either be a string, a python [re.Pattern](https://docs.python.org/3/library/re.html) instance or a [httpx.URL](https://www.python-httpx.org/api/#url) instance.
425
+
`url` parameter can either be a string, a python [`re.Pattern`](https://docs.python.org/3/library/re.html) instance or a [`httpx.URL`](https://www.python-httpx.org/api/#url) instance.
426
426
427
427
Matching is performed on the full URL, query parameters included.
428
428
@@ -616,6 +616,7 @@ Below is a list of parameters that will require a change in your code.
0 commit comments