public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pydantic-extra-types] f43: Patch tests for Pydantic 3.13
@ 2026-08-17 15:43 Benjamin A. Beasley
0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-08-17 15:43 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-pydantic-extra-types
Branch : f43
Commit : 1900e23d197f75d961d50e75653254056a4aecfc
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-05-13T20:01:32+01:00
Stats : +189/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-pydantic-extra-types/c/1900e23d197f75d961d50e75653254056a4aecfc?branch=f43
Log:
Patch tests for Pydantic 3.13
---
diff --git a/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch b/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
new file mode 100644
index 0000000..a8c5bdf
--- /dev/null
+++ b/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
@@ -0,0 +1,186 @@
+From 6f0217de5e26b99d09ffd9bb95da415779e6bef6 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Wed, 13 May 2026 16:45:47 +0100
+Subject: [PATCH] fix: Adjust tests for Pydantic 2.13 (#394)
+
+https://github.com/pydantic/pydantic/pull/12815 has the effect of adding
+a new `description` member to the `Coordinate` schema. Ignore it so
+that tests pass with both old and new versions.
+---
+ tests/test_coordinate.py | 85 +++++++++++++++++++++------------------
+ tests/test_json_schema.py | 41 ++++++++++---------
+ 2 files changed, 67 insertions(+), 59 deletions(-)
+
+diff --git a/tests/test_coordinate.py b/tests/test_coordinate.py
+index 99e9365e..74e515a6 100644
+--- a/tests/test_coordinate.py
++++ b/tests/test_coordinate.py
+@@ -3,6 +3,7 @@
+ from typing import Any, Optional, Union
+
+ import pytest
++from dirty_equals import IsPartialDict
+ from pydantic import BaseModel, ValidationError
+ from pydantic_core._pydantic_core import ArgsKwargs
+
+@@ -215,27 +216,29 @@ def test_json_schema():
+ class Model(BaseModel):
+ value: Coordinate
+
+- assert Model.model_json_schema(mode='validation')['$defs']['Coordinate'] == {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
+- },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
++ assert Model.model_json_schema(mode='validation')['$defs']['Coordinate'] == IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
+- },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
++ }
++ )
+ assert Model.model_json_schema(mode='validation')['properties']['value'] == {
+ 'anyOf': [
+ {'$ref': '#/$defs/Coordinate'},
+@@ -254,27 +257,29 @@ class Model(BaseModel):
+ }
+ assert Model.model_json_schema(mode='serialization') == {
+ '$defs': {
+- 'Coordinate': {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
++ 'Coordinate': IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
+- },
+- },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
++ }
++ )
+ },
+ 'properties': {'value': {'$ref': '#/$defs/Coordinate', 'title': 'Value'}},
+ 'required': ['value'],
+diff --git a/tests/test_json_schema.py b/tests/test_json_schema.py
+index 62748d3a..f82219b7 100644
+--- a/tests/test_json_schema.py
++++ b/tests/test_json_schema.py
+@@ -2,6 +2,7 @@
+
+ import pycountry
+ import pytest
++from dirty_equals import IsPartialDict
+ from pydantic import BaseModel
+
+ import pydantic_extra_types
+@@ -189,27 +190,29 @@
+ Coordinate,
+ {
+ '$defs': {
+- 'Coordinate': {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
+- },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
++ 'Coordinate': IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
+ },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ )
+ },
+ 'properties': {
+ 'x': {
diff --git a/python-pydantic-extra-types.spec b/python-pydantic-extra-types.spec
index 82744c4..7638c16 100644
--- a/python-pydantic-extra-types.spec
+++ b/python-pydantic-extra-types.spec
@@ -20,6 +20,9 @@ License: MIT
URL: %{forgeurl}
Source: %{forgesource}
+# fix: Adjust tests for Pydantic 2.13
+Patch: %{forgeurl}/commit/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
+
BuildArch: noarch
BuildRequires: python3-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-17 15:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-17 15:43 [rpms/python-pydantic-extra-types] f43: Patch tests for Pydantic 3.13 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