From 406fb6e1cfb5e5684fe3311c7f5393e4e8531bf4 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 15 Dec 2024 09:54:23 -0700 Subject: [PATCH] Change update-release-info test for Python changes Signed-off-by: Mats Wichmann --- CHANGES.txt | 2 ++ test/update-release-info/update-release-info.py | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f074da86e7..f7f20896c4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -181,6 +181,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Only object-like macros are replaced (not function-like), and only on a whole-word basis; recursion is limited to five levels and does not error out if that limit is reached (issue #4523). + - The update-release-info test is adapted to accept changed help output + introduced in Python 3.12.8/3.13.1. RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700 diff --git a/test/update-release-info/update-release-info.py b/test/update-release-info/update-release-info.py index 2de4713b0c..bebd8a9875 100644 --- a/test/update-release-info/update-release-info.py +++ b/test/update-release-info/update-release-info.py @@ -53,11 +53,24 @@ if not os.path.exists(test.program): test.skip_test("update-release-info.py is not distributed in this package\n") -expected_stderr = """usage: update-release-info.py [-h] [--verbose] [--timestamp TIMESTAMP] +expected_stderr = """\ +usage: update-release-info.py [-h] [--verbose] [--timestamp TIMESTAMP] [{develop,release,post}] update-release-info.py: error: argument mode: invalid choice: 'bad' (choose from 'develop', 'release', 'post') """ -test.run(arguments='bad', stderr=expected_stderr, status=2) +# The way the choices are rendered in help by argparse changed with +# Python 3.12.8, # 3.13.1, 3.14.0a2. Change the test to accept either. +expected_stderr_new = """\ +usage: update-release-info.py [-h] [--verbose] [--timestamp TIMESTAMP] + [{develop,release,post}] +update-release-info.py: error: argument mode: invalid choice: 'bad' (choose from develop, release, post) +""" +test.run(arguments='bad', stderr=None, status=2) +fail_strings = [ + expected_stderr, + expected_stderr_new, +] +test.must_contain_any_line(test.stderr(), fail_strings) # Strings to go in ReleaseConfig combo_strings = [