public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-fastapi] rawhide: Patch tests for httpx2
@ 2026-06-12 11:16 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-06-12 11:16 UTC (permalink / raw)
  To: git-commits

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-}
 
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-12 11:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-12 11:16 [rpms/python-fastapi] rawhide: Patch tests for httpx2 Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox