Skip to content

Commit

Permalink
Merge pull request #81 from Colin-b/develop
Browse files Browse the repository at this point in the history
Release 0.21.0
  • Loading branch information
Colin-b authored May 24, 2022
2 parents c3a8e45 + cde1d24 commit ef1637c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.21.0] - 2022-05-24
### Changed
- Requires [`httpx`](https://www.python-httpx.org)==0.23.\*

### Removed
- Python 3.6 is no longer supported.

## [0.20.0] - 2022-02-05
### Added
- Add support for [`pytest`](https://docs.pytest.org)==7.\* ([`pytest`](https://docs.pytest.org)==6.\* is still supported for now). (many thanks to [`Craig Blaszczyk`](https://github.com/jakul))
Expand All @@ -14,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Requires [`httpx`](https://www.python-httpx.org)==0.22.\*

### Removed
### Deprecated
- Python 3.6 is no longer supported.

## [0.18.0] - 2022-01-17
Expand Down Expand Up @@ -216,7 +223,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- First release, should be considered as unstable for now as design might change.

[Unreleased]: https://github.com/Colin-b/pytest_httpx/compare/v0.20.0...HEAD
[Unreleased]: https://github.com/Colin-b/pytest_httpx/compare/v0.21.0...HEAD
[0.21.0]: https://github.com/Colin-b/pytest_httpx/compare/v0.20.0...v0.21.0
[0.20.0]: https://github.com/Colin-b/pytest_httpx/compare/v0.19.0...v0.20.0
[0.19.0]: https://github.com/Colin-b/pytest_httpx/compare/v0.18.0...v0.19.0
[0.18.0]: https://github.com/Colin-b/pytest_httpx/compare/v0.17.3...v0.18.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ from pytest_httpx import HTTPXMock


def test_headers_matching(httpx_mock: HTTPXMock):
httpx_mock.add_response(match_headers={'user-agent': 'python-httpx/0.21.0'})
httpx_mock.add_response(match_headers={'user-agent': 'python-httpx/0.23.0'})

with httpx.Client() as client:
response = client.get("https://test_url")
Expand Down
2 changes: 1 addition & 1 deletion pytest_httpx/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Major should be incremented in case there is a breaking change. (eg: 2.5.8 -> 3.0.0)
# Minor should be incremented in case there is an enhancement. (eg: 2.5.8 -> 2.6.0)
# Patch should be incremented in case there is a bug fix. (eg: 2.5.8 -> 2.5.9)
__version__ = "0.20.0"
__version__ = "0.21.0"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
packages=find_packages(exclude=["tests*"]),
package_data={"pytest_httpx": ["py.typed"]},
entry_points={"pytest11": ["pytest_httpx = pytest_httpx"]},
install_requires=["httpx==0.22.*", "pytest>=6.*,<8.*"],
install_requires=["httpx==0.23.*", "pytest>=6.*,<8.*"],
extras_require={
"testing": [
# Used to run async test functions
Expand All @@ -49,7 +49,7 @@
"pytest-cov==3.*",
]
},
python_requires=">=3.6",
python_requires=">=3.7",
project_urls={
"GitHub": "https://github.com/Colin-b/pytest_httpx",
"Changelog": "https://github.com/Colin-b/pytest_httpx/blob/master/CHANGELOG.md",
Expand Down
8 changes: 2 additions & 6 deletions tests/test_httpx_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,14 @@ async def test_default_response_streaming(httpx_mock: HTTPXMock) -> None:

async with httpx.AsyncClient() as client:
async with client.stream(method="GET", url="https://test_url") as response:
assert [part async for part in response.aiter_raw()] == [
b"",
]
assert [part async for part in response.aiter_raw()] == []
# Assert that stream still behaves the proper way (can only be consumed once per request)
with pytest.raises(httpx.StreamConsumed):
async for part in response.aiter_raw():
pass

async with client.stream(method="GET", url="https://test_url") as response:
assert [part async for part in response.aiter_raw()] == [
b"",
]
assert [part async for part in response.aiter_raw()] == []
# Assert that stream still behaves the proper way (can only be consumed once per request)
with pytest.raises(httpx.StreamConsumed):
async for part in response.aiter_raw():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_httpx_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ def test_default_response_streaming(httpx_mock: HTTPXMock) -> None:

with httpx.Client() as client:
with client.stream(method="GET", url="https://test_url") as response:
assert list(response.iter_raw()) == [b""]
assert list(response.iter_raw()) == []
# Assert that stream still behaves the proper way (can only be consumed once per request)
with pytest.raises(httpx.StreamConsumed):
list(response.iter_raw())

# Assert a response can be streamed more than once
with client.stream(method="GET", url="https://test_url") as response:
assert list(response.iter_raw()) == [b""]
assert list(response.iter_raw()) == []
# Assert that stream still behaves the proper way (can only be consumed once per request)
with pytest.raises(httpx.StreamConsumed):
list(response.iter_raw())
Expand Down

0 comments on commit ef1637c

Please sign in to comment.