From 210b819dbb11e700c8ddc6c93d53f125f3905588 Mon Sep 17 00:00:00 2001 From: Colin-b Date: Thu, 19 Sep 2024 22:27:25 +0200 Subject: [PATCH 1/2] Drop pytest 7 support --- .github/workflows/test.yml | 2 -- CHANGELOG.md | 2 ++ pyproject.toml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d99a8b..5b163c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,6 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - pytest-major-version: ['7', '8'] steps: - uses: actions/checkout@v4 @@ -21,7 +20,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e .[testing] - python -m pip install pytest~=${{ matrix.pytest-major-version }}.0 - name: Test run: | pytest --cov=pytest_httpx --cov-fail-under=100 --cov-report=term-missing --runpytest=subprocess diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7855f..5cd255a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Removed +- `pytest` `7` is not supported anymore (`pytest` `8` has been out for 9 months already). ## [0.30.0] - 2024-02-21 ### Changed diff --git a/pyproject.toml b/pyproject.toml index cc0390e..90909b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ classifiers = [ ] dependencies = [ "httpx==0.27.*", - "pytest>=7,<9", + "pytest==8.*", ] dynamic = ["version"] @@ -50,9 +50,9 @@ issues = "https://github.com/Colin-b/pytest_httpx/issues" [project.optional-dependencies] testing = [ # Used to check coverage - "pytest-cov==4.*", + "pytest-cov==5.*", # Used to run async tests - "pytest-asyncio==0.23.*", + "pytest-asyncio==0.24.*", ] [project.entry-points.pytest11] From 1d135ad99a89dfc093155626e9ead88ce376efa4 Mon Sep 17 00:00:00 2001 From: Colin-b Date: Thu, 19 Sep 2024 22:31:40 +0200 Subject: [PATCH 2/2] Update black --- .pre-commit-config.yaml | 2 +- pytest_httpx/_pretty_print.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43c0278..8856f1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.8.0 hooks: - id: black \ No newline at end of file diff --git a/pytest_httpx/_pretty_print.py b/pytest_httpx/_pretty_print.py index ddedf7c..f79fd1e 100644 --- a/pytest_httpx/_pretty_print.py +++ b/pytest_httpx/_pretty_print.py @@ -18,11 +18,11 @@ def __init__( headers_encoding = request.headers.encoding self.expected_headers = { - # httpx uses lower cased header names as internal key - header.lower().encode(headers_encoding) - for matcher in matchers - if matcher.headers - for header in matcher.headers + # httpx uses lower cased header names as internal key + header.lower().encode(headers_encoding) + for matcher in matchers + if matcher.headers + for header in matcher.headers } self.expect_body = any( [