Skip to content

Commit

Permalink
Make UtilsTests.test_filter_params Python 3.13+ compatible
Browse files Browse the repository at this point in the history
Since Python 3.13.0a1, docstrings are automatically dedented.
See python/cpython#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
(6c0c791)
does not specify why testing the spaces is important.
  • Loading branch information
hroncok authored and auvipy committed Oct 25, 2023
1 parent eddb461 commit fe020db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/oauth1/rfc5849/test_utils.py
Expand Up @@ -53,11 +53,11 @@ def test_filter_params(self):
# 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'
Expand Down

0 comments on commit fe020db

Please sign in to comment.