From ffb8a38f26964a4b91b7404b244df680fcd73a36 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 26 Aug 2021 16:48:02 -0700 Subject: [PATCH] test_default_arguments: Adjust for Python 3.10. Signed-off-by: Anders Kaseorg --- zulip/tests/test_default_arguments.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zulip/tests/test_default_arguments.py b/zulip/tests/test_default_arguments.py index e79f795..03a7d0b 100755 --- a/zulip/tests/test_default_arguments.py +++ b/zulip/tests/test_default_arguments.py @@ -19,17 +19,16 @@ class TestDefaultArguments(TestCase): parser.parse_args(["invalid argument"]) self.assertEqual(cm.exception.code, 2) # Assert that invalid arguments exit with printing the full usage (non-standard behavior) - self.assertTrue( - mock_stderr.getvalue().startswith( - """usage: lorem ipsum + self.assertRegex( + mock_stderr.getvalue(), + r"""^usage: lorem ipsum -optional arguments: +(optional arguments|options): -h, --help show this help message and exit Zulip API configuration: --site ZULIP_SITE Zulip server URI -""" - ) +""", ) @patch("os.path.exists", return_value=False)