File: py313.patch

package info (click to toggle)
python-oauthlib 3.2.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,352 kB
  • sloc: python: 10,845; sh: 16; makefile: 5
file content (40 lines) | stat: -rw-r--r-- 1,785 bytes parent folder | download | duplicates (2)
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
From: =?utf-8?q?Miro_Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 24 Oct 2023 15:08:10 +0200
Subject: Make UtilsTests.test_filter_params Python 3.13+ compatible

Since Python 3.13.0a1, docstrings are automatically dedented.
See https://github.com/python/cpython/issues/81283
and https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes

As a result, using a docstring with leading space as a test case
breaks the test assumption.

The initial commit which introduced this test a decade ago
(6c0c7914f3a57823834b1be492b307992f943629)
does not specify why testing the spaces is important.

Origin: upstream, https://github.com/oauthlib/oauthlib/pull/866
Bug-Debian: https://bugs.debian.org/1082235
Last-Update: 2024-10-09
---
 tests/oauth1/rfc5849/test_utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/oauth1/rfc5849/test_utils.py b/tests/oauth1/rfc5849/test_utils.py
index 013c71a..2212890 100644
--- a/tests/oauth1/rfc5849/test_utils.py
+++ b/tests/oauth1/rfc5849/test_utils.py
@@ -53,11 +53,11 @@ class UtilsTests(TestCase):
         # The following is an isolated test function used to test the filter_params decorator.
         @filter_params
         def special_test_function(params, realm=None):
-            """ I am a special test function """
+            """I am a special test function"""
             return 'OAuth ' + ','.join(['='.join([k, v]) for k, v in params])
 
         # check that the docstring got through
-        self.assertEqual(special_test_function.__doc__, " I am a special test function ")
+        self.assertEqual(special_test_function.__doc__, "I am a special test function")
 
         # Check that the decorator filtering works as per design.
         #   Any param that does not start with 'oauth'