tests/_alias_httpx.py
raw| 1 | """Loaded as an early pytest plugin (`-p tests._alias_httpx` in `pyproject.toml`). |
| 2 | |
| 3 | `respx` mocks `httpx`, while this SDK is built on `httpx2`, so we make `import httpx` (and `httpcore`) |
| 4 | resolve to `httpx2` (and `httpcore2`) before `respx` is imported, which lets it mock our client. |
| 5 | """ |
| 6 | |
| 7 | import httpx2 |
| 8 | |
| 9 | httpx2.alias_httpx() |