From 9b66f4066cfb78e3a2e40824b4f9d532f494b9a4 Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Thu, 11 Feb 2021 09:46:37 +0100 Subject: Update unit test to satisfy python3.10+ Fedora is already testing Python 3.10 [1] and an issue has been raised [2]. All the details are in the BZ ticket but TLDR is that "optional arguments" was replaced with "options [3]. So, I used assertRegexp to accept both of them (i.e "optional arguments" and "options"). [1] https://fedoraproject.org/wiki/Changes/Python3.10 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1914138 [3] https://github.com/python/cpython/commit/fb35fa49d192368e94ffec09c092260ed0fea2e1 Change-Id: I18d9f1bea7bb5a7afb273550314c36da7b466a69 --- cliff/tests/test_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cliff/tests/test_help.py b/cliff/tests/test_help.py index 9034779..4862f25 100644 --- a/cliff/tests/test_help.py +++ b/cliff/tests/test_help.py @@ -101,7 +101,7 @@ class TestHelp(base.TestBase): help_text = stdout.getvalue() basecommand = os.path.split(sys.argv[0])[1] self.assertIn('usage: %s [--version]' % basecommand, help_text) - self.assertIn('optional arguments:\n --version', help_text) + self.assertRegex(help_text, 'option(s|al arguments):\n --version') expected = ( ' one Test command.\n' ' three word command Test command.\n' -- cgit v1.2.1