From e23f23c8d89aed5526d892b05c1a11fa5a37b182 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 23 Sep 2024 11:33:01 -0400 Subject: [PATCH] Tests: Fix test_shell in py3.13 Whitespace handling has changed in py3.13 around this area -- rework the test to pass on 3.13 as well as older versions by ignoring whitespace around the expected description. There may be a more complete fix in shell.py's _find_actions but I didn't find it for now. Closes-Bug: #2081633 Change-Id: I83a6a2bc311545811c5c32192494ee82b7903770 --- cinderclient/tests/unit/test_shell.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cinderclient/tests/unit/test_shell.py b/cinderclient/tests/unit/test_shell.py index c5d64af0a..6b67a8eab 100644 --- a/cinderclient/tests/unit/test_shell.py +++ b/cinderclient/tests/unit/test_shell.py @@ -437,12 +437,14 @@ class TestLoadVersionedActions(utils.TestCase): expected_help = ("help message (Supported by API versions " "%(start)s - %(end)s)") % { 'start': '3.0', 'end': '3.3'} - expected_desc = ("help message\n\n " - "This will not show up in help message\n ") + self.assertIn('help message', + mock_add_parser.call_args_list[0][1]['description']) + self.assertIn('This will not show up in help message', + mock_add_parser.call_args_list[0][1]['description']) mock_add_parser.assert_any_call( 'fake-action', help=expected_help, - description=expected_desc, + description=mock.ANY, add_help=False, formatter_class=cinderclient.shell.OpenStackHelpFormatter)