diff mbox series

[meta-python,3/3] python3-dominate: Fix ptests with python 3.13

Message ID 20241028171456.2462158-3-raj.khem@gmail.com
State New
Headers show
Series [meta-python,1/3] python3-html2text: Add missing rdep on py3 html module | expand

Commit Message

Khem Raj Oct. 28, 2024, 5:14 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...d7fdb171f80ed6ce97e6ca4409723975c47f.patch | 40 +++++++++++++++++++
 .../python/python3-dominate_2.9.1.bb          |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-dominate/58f7d7fdb171f80ed6ce97e6ca4409723975c47f.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-dominate/58f7d7fdb171f80ed6ce97e6ca4409723975c47f.patch b/meta-python/recipes-devtools/python/python3-dominate/58f7d7fdb171f80ed6ce97e6ca4409723975c47f.patch
new file mode 100644
index 0000000000..e3d0d485ee
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-dominate/58f7d7fdb171f80ed6ce97e6ca4409723975c47f.patch
@@ -0,0 +1,40 @@ 
+From 58f7d7fdb171f80ed6ce97e6ca4409723975c47f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 3 Aug 2024 16:07:38 +0200
+Subject: [PATCH] Update tests for docstring dedenting in Python 3.13
+
+Update the `get_expected()` function to account for the fact that
+Python 3.13 automatically dedents all the docstrings, and therefore
+does not require explicitly removing the indent (which effectively
+removes too much indent).
+
+Fixes #199
+
+Upstream-Status: Submitted [https://github.com/Knio/dominate/pull/202]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test_svg.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_svg.py b/tests/test_svg.py
+index e5bbec3..ea7d98f 100644
+--- a/tests/test_svg.py
++++ b/tests/test_svg.py
+@@ -1,3 +1,5 @@
++import sys
++
+ import dominate.svg
+ from dominate.tags import *
+ from dominate.svg import *
+@@ -14,7 +16,10 @@ def base():
+ 
+ 
+ def get_expected(func):
+-  return func.__doc__.replace('\n  ', '\n').strip()
++  doc = func.__doc__
++  if sys.version_info < (3, 13):
++      doc = doc.replace('\n  ', '\n')
++  return doc.strip()
+ 
+ 
+ def output_test(func):
diff --git a/meta-python/recipes-devtools/python/python3-dominate_2.9.1.bb b/meta-python/recipes-devtools/python/python3-dominate_2.9.1.bb
index 054d5236e5..cce304498a 100644
--- a/meta-python/recipes-devtools/python/python3-dominate_2.9.1.bb
+++ b/meta-python/recipes-devtools/python/python3-dominate_2.9.1.bb
@@ -7,6 +7,7 @@  SRC_URI[sha256sum] = "558284687d9b8aae1904e3d6051ad132dd4a8c0cf551b37ea4e7e42a31
 inherit pypi ptest python_setuptools_build_meta
 
 SRC_URI += " \
+    file://58f7d7fdb171f80ed6ce97e6ca4409723975c47f.patch \
 	file://run-ptest \
 "