Skip to content

Fix typos #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2022
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Require `HTTPX` 0.18.0 and implement the new transport API. (PR #142)
- Removed ASGI and WSGI transports from httpcore patch list. (PR #131)
- Don't pre-read mocked async resposne streams. (PR #136)
- Don't pre-read mocked async response streams. (PR #136)

### Fixed
- Fixed syntax highlighting in docs, thanks @florimondmanca. (PR #134)
Expand Down
8 changes: 4 additions & 4 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ respx.route(method__in=["PUT", "PATCH"])

#### Combining Patterns

For even more flexability, you can define combined patterns using the [M()](api.md#m) *object*, together with bitwise [operators](api.md#operators) (`&`, `|,` `~`), creating a reusable pattern.
For even more flexibility, you can define combined patterns using the [M()](api.md#m) *object*, together with bitwise [operators](api.md#operators) (`&`, `|,` `~`), creating a reusable pattern.

``` python
hosts_pattern = M(host="example.org") | M(host="example.com")
Expand Down Expand Up @@ -609,7 +609,7 @@ import respx
@respx.mock
def test_remote_response():
respx.route(host="localhost").pass_through()
response = httpx.get("http://localhost:8000/") # respose from server
response = httpx.get("http://localhost:8000/") # response from server
```

> See [.pass_through()](api.md#pass_through) reference for more details.
Expand Down Expand Up @@ -659,9 +659,9 @@ respx.calls.assert_not_called()
respx.calls.assert_called_once()
```

### Retreiving mocked calls
### Retrieving mocked calls

A matched and mocked `Call` can be retrived from call history, by either unpacking...
A matched and mocked `Call` can be retrieved from call history, by either unpacking...

``` python
request, response = respx.calls.last
Expand Down
2 changes: 1 addition & 1 deletion docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ respx.post("https://some.url/").mock(
],
)
```
> **Note:** Repeating a route in `0.15.0+` replaces any exising route with same pattern.
> **Note:** Repeating a route in `0.15.0+` replaces any existing route with same pattern.

## Aliasing
Aliases changed to *named routes*:
Expand Down
8 changes: 4 additions & 4 deletions docs/versions/0.14.0/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!!! attention "Warning"
This is the documentaion of the older version `0.14.0`. See [latest](../../../) for current release.
This is the documentation of the older version `0.14.0`. See [latest](../../../) for current release.

# Developer Interface - Version 0.14.0

Expand Down Expand Up @@ -282,7 +282,7 @@ def test_something():

## Built-in Assertions

RESPX has the following build-in assertion checks:
RESPX has the following built-in assertion checks:

> * **assert_all_mocked**
> Asserts that all captured `HTTPX` requests are mocked. Defaults to `True`.
Expand Down Expand Up @@ -318,8 +318,8 @@ with respx.mock(assert_all_mocked=False) as respx_mock:
The `respx` API includes a `.calls` object, containing captured (`request`, `response`) named tuples and MagicMock's *bells and whistles*, i.e. `call_count`, `assert_called` etc.


### Retreiving mocked calls
A matched and mocked `Call` can be retrived from call history, by either unpacking...
### Retrieving mocked calls
A matched and mocked `Call` can be retrieved from call history, by either unpacking...

``` python
request, response = respx.calls.last
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/0.14.0/mocking.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!!! attention "Warning"
This is the documentaion of the older version `0.14.0`. See [latest](../../../) for current release.
This is the documentation of the older version `0.14.0`. See [latest](../../../) for current release.

# Mock HTTPX - Version 0.14.0

Expand Down
2 changes: 1 addition & 1 deletion respx/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def merge_patterns(pattern: Pattern, **bases: Pattern) -> Pattern:
# Pattern is "absolute", skip merging
bases = None
else:
# Traverse pattern and set releated base
# Traverse pattern and set related base
for _pattern in patterns:
base = bases.pop(_pattern.key, None)
# Skip "exact" base + don't overwrite existing base
Expand Down
4 changes: 2 additions & 2 deletions respx/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def __call__(
for global state, i.e. shared patterns added outside of scope.
"""
if func is None:
# Parantheses used, branch out to new nested instance.
# Parentheses used, branch out to new nested instance.
# - Only stage when using local ctx `with respx.mock(...) as respx_mock:`
# - First stage when using local decorator `@respx.mock(...)`
# FYI, global ctx `with respx.mock:` hits __enter__ directly
Expand Down Expand Up @@ -418,7 +418,7 @@ def sync_decorator(*args, **kwargs):
async_decorator = update_wrapper(async_decorator, func)
sync_decorator = update_wrapper(sync_decorator, func)

# Dispatch async/sync decorator, depening on decorated function.
# Dispatch async/sync decorator, depending on decorated function.
# - Only stage when using global decorator `@respx.mock`
# - Second stage when using local decorator `@respx.mock(...)`
return async_decorator if inspect.iscoroutinefunction(func) else sync_decorator
Expand Down
2 changes: 1 addition & 1 deletion tests/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_rollback():
assert router.calls.call_count == 0
assert route.return_value is None

router.rollback() # Empty inital state
router.rollback() # Empty initial state

assert len(router.routes) == 0
assert route.return_value is None
Expand Down