public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-fastapi] rawhide: Patch tests for httpx2
Date: Fri, 12 Jun 2026 11:16:53 GMT	[thread overview]
Message-ID: <178126301365.1.358101369119759224.rpms-python-fastapi-1fab3fc1dd3e@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-fastapi
Branch : rawhide
Commit : 1fab3fc1dd3e9c98a7290caf4dcc5043000ca891
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-06-12T12:16:41+01:00
Stats  : +62/-5 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-fastapi/c/1fab3fc1dd3e9c98a7290caf4dcc5043000ca891?branch=rawhide

Log:
Patch tests for httpx2

---
diff --git a/fastapi-0.136.3-httpx2.patch b/fastapi-0.136.3-httpx2.patch
new file mode 100644
index 0000000..5b0c028
--- /dev/null
+++ b/fastapi-0.136.3-httpx2.patch
@@ -0,0 +1,57 @@
+diff --git a/tests/test_tutorial/test_header_param_models/test_tutorial001.py b/tests/test_tutorial/test_header_param_models/test_tutorial001.py
+index 8391bd1197da8..cc274cd64dce4 100644
+--- a/tests/test_tutorial/test_header_param_models/test_tutorial001.py
++++ b/tests/test_tutorial/test_header_param_models/test_tutorial001.py
+@@ -1,6 +1,7 @@
+ import importlib
+ 
+ import pytest
++from dirty_equals import IsOneOf
+ from fastapi.testclient import TestClient
+ from inline_snapshot import snapshot
+ 
+@@ -68,7 +69,9 @@ def test_header_param_model_invalid(client: TestClient):
+                         "x_tag": [],
+                         "host": "testserver",
+                         "accept": "*/*",
+-                        "accept-encoding": "gzip, deflate",
++                        "accept-encoding": IsOneOf(
++                            "gzip, deflate", "gzip, deflate, zstd"
++                        ),
+                         "connection": "keep-alive",
+                         "user-agent": "testclient",
+                     },
+diff --git a/tests/test_tutorial/test_header_param_models/test_tutorial003.py b/tests/test_tutorial/test_header_param_models/test_tutorial003.py
+index 7d0da24fd5791..de2fb87ec6cf0 100644
+--- a/tests/test_tutorial/test_header_param_models/test_tutorial003.py
++++ b/tests/test_tutorial/test_header_param_models/test_tutorial003.py
+@@ -1,6 +1,7 @@
+ import importlib
+ 
+ import pytest
++from dirty_equals import IsOneOf
+ from fastapi.testclient import TestClient
+ from inline_snapshot import snapshot
+ 
+@@ -66,7 +67,9 @@ def test_header_param_model_no_underscore(client: TestClient):
+                         "traceparent": "123",
+                         "x_tag": [],
+                         "accept": "*/*",
+-                        "accept-encoding": "gzip, deflate",
++                        "accept-encoding": IsOneOf(
++                            "gzip, deflate", "gzip, deflate, zstd"
++                        ),
+                         "connection": "keep-alive",
+                         "user-agent": "testclient",
+                         "save-data": "true",
+@@ -105,7 +108,9 @@ def test_header_param_model_invalid(client: TestClient):
+                         "x_tag": [],
+                         "host": "testserver",
+                         "accept": "*/*",
+-                        "accept-encoding": "gzip, deflate",
++                        "accept-encoding": IsOneOf(
++                            "gzip, deflate", "gzip, deflate, zstd"
++                        ),
+                         "connection": "keep-alive",
+                         "user-agent": "testclient",
+                     },

diff --git a/python-fastapi.spec b/python-fastapi.spec
index 5be8a34..ff2df06 100644
--- a/python-fastapi.spec
+++ b/python-fastapi.spec
@@ -43,6 +43,10 @@ BuildArch:      noarch
 # Downstream-only: run test_fastapi_cli without coverage
 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
 Patch:          0001-Downstream-only-run-test_fastapi_cli-without-coverag.patch
+# Update a couple of tests in tests/test_tutorial/test_header_param_models for
+# httpx2; backported from
+# https://github.com/fastapi/fastapi/commit/59d4a80fcf8a7b3a46b2560f75dc0d171e7ea8ff.
+Patch:          fastapi-0.136.3-httpx2.patch
 
 # Since dependency groups contain overly-strict version bounds and some
 # unwanted linting/coverage/typechecking/formatting dependencies
@@ -59,6 +63,7 @@ BuildRequires:  %{py3_dist orjson} >= 3.9.3
 %endif
 # docs-tests:
 BuildRequires:  %{py3_dist httpx} >= 0.23
+BuildRequires:  %{py3_dist httpx2} >= 2
 # (we don’t actually need ruff)
 # tests:
 BuildRequires:  %{py3_dist anyio[trio]} >= 3.2.1
@@ -247,11 +252,6 @@ ignore="${ignore-} --ignore-glob=scripts/tests/*"
 # dependency versions in CI.
 warningsfilter="${warningsfilter-} -W ignore::DeprecationWarning"
 
-# FastAPI runs tests using Starlette’s test client, which has deprecated
-# support for httpx; until we have a python-httpx2 package to use instead, we
-# must ignore this. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2483715.
-warningsfilter="${warningsfilter-} -W ignore::starlette.exceptions.StarletteDeprecationWarning"
-
 %pytest ${warningsfilter-} -k "${k-}" ${ignore-}
 
 

                 reply	other threads:[~2026-06-12 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178126301365.1.358101369119759224.rpms-python-fastapi-1fab3fc1dd3e@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox