summarylogtreecommitdiffstats
path: root/tests-skipif-python-3.13.patch
blob: dbc5e680d05e9e045983f369e7e14328a8a7ef6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From b686b1d4980503bb0d666141c3009b08149cfdd3 Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Mon, 23 Dec 2024 12:07:49 +0100
Subject: [PATCH] Conditionally skip docstring indentation tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Python 3.13 introduced new semantics [1] for docstring contents,
which are now de-dented by default (gh-81283) [2].

This breaks a couple of Numpy’s tests that assume docstring
preservation, so skip those when on Python 3.13.

Reported by AUR user gwuensch.

[1]: https://docs.python.org/3/whatsnew/3.13.html#other-language-changes

[2]: https://github.com/python/cpython/issues/81283
---
 numpy/lib/tests/test_utils.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py
index 45416b0597..2c2b4181f6 100644
--- a/numpy/lib/tests/test_utils.py
+++ b/numpy/lib/tests/test_utils.py
@@ -88,6 +88,7 @@ def test_deprecate_with_doc_decorator_message():
 
 
 @pytest.mark.skipif(sys.flags.optimize == 2, reason="-OO discards docstrings")
+@pytest.mark.skipif(sys.version_info >= (3, 13), reason="see gh-81283")
 @pytest.mark.parametrize('old_func, new_func', [
     (old_func4, new_func4),
     (old_func5, new_func5),
@@ -112,6 +113,7 @@ def _compare_docs(old_func, new_func):
 
 
 @pytest.mark.skipif(sys.flags.optimize == 2, reason="-OO discards docstrings")
+@pytest.mark.skipif(sys.version_info >= (3, 13), reason="see gh-81283")
 def test_deprecate_preserve_whitespace():
     assert_('\n        Bizarre' in new_func5.__doc__)
 
-- 
2.47.1