Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ A clear and concise description of what you expected to happen.

**Steps to reproduce**
```python
def test_issue(httpx_mock):
...
def test_issue(httpx2_mock): ...
```
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
name: python-package-distributions
path: dist/

# astral-sh/setup-uv v8.1.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
Expand Down
16 changes: 9 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
```python
import pytest


@pytest.mark.httpx_mock(non_mocked_hosts=["my_local_test_host"])
def test_previous_behavior(httpx_mock):
...
def test_previous_behavior(httpx_mock): ...


@pytest.mark.httpx_mock(should_mock=lambda request: request.url.host not in ["my_local_test_host"])
def test_new_behavior(httpx_mock):
...
@pytest.mark.httpx_mock(
should_mock=lambda request: request.url.host not in ["my_local_test_host"]
)
def test_new_behavior(httpx_mock): ...
```
Please note that your hosts might need to be prefixed with `www.` depending on your usage.

Expand Down Expand Up @@ -136,10 +138,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Apply marker to whole module
pytestmark = pytest.mark.httpx_mock(assert_all_responses_were_requested=False)


# Or to specific tests
@pytest.mark.httpx_mock(non_mocked_hosts=[...])
def test_foo(httpx_mock):
...
def test_foo(httpx_mock): ...
```
- The following options are available:
- `assert_all_responses_were_requested` (boolean), defaulting to `True`.
Expand Down
Loading
Loading