summaryrefslogtreecommitdiff
path: root/dev-python/oslo-config/files/oslo-config-9.4.0-py313.patch
blob: b3e6979f9e4f8c1950256bcd1b87af68fa32c634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 4f916edb457eb02bede0a7c4a64741ef13709af7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Wed, 12 Jun 2024 07:47:18 +0200
Subject: [PATCH] Fix tests for Python 3.13
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix expected argparse --help output to account for changes in Python
3.13.

Closes-Bug: 2069108
Change-Id: Ie221e5f5b369930f015a74998f50ddb473b53b94
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 oslo_config/tests/test_cfg.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/oslo_config/tests/test_cfg.py b/oslo_config/tests/test_cfg.py
index 926eb8c..f69f7a0 100644
--- a/oslo_config/tests/test_cfg.py
+++ b/oslo_config/tests/test_cfg.py
@@ -264,8 +264,14 @@ class HelpTestCase(BaseTestCase):
         self.conf.register_cli_opt(uvw)
         self.conf([])
         self.conf.print_help(file=f)
-        self.assertIn('--a-bc A_BC, --d-ef A_BC, --d_ef A_BC', f.getvalue())
-        self.assertIn('--u-vw U_VW, --x-yz U_VW, --x_yz U_VW', f.getvalue())
+        if sys.version_info >= (3, 13):
+            self.assertIn('--a-bc, --d-ef, --d_ef A_BC', f.getvalue())
+            self.assertIn('--u-vw, --x-yz, --x_yz U_VW', f.getvalue())
+        else:
+            self.assertIn('--a-bc A_BC, --d-ef A_BC, --d_ef A_BC',
+                          f.getvalue())
+            self.assertIn('--u-vw U_VW, --x-yz U_VW, --x_yz U_VW',
+                          f.getvalue())
 
 
 class FindConfigFilesTestCase(BaseTestCase):
-- 
2.45.2