From patchwork Wed Dec 13 13:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753517 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp180923wrr; Wed, 13 Dec 2023 05:03:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu9uxYYQYlmon/Wu5n7aLqCqEQaYZQB/AJxAQEz/aJJ8vsuIXXpnmc/VgUdarHzOzrewJU X-Received: by 2002:a05:6102:152a:b0:464:77f2:560 with SMTP id f42-20020a056102152a00b0046477f20560mr6867832vsv.50.1702472614709; Wed, 13 Dec 2023 05:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472614; cv=none; d=google.com; s=arc-20160816; b=0xueAQPdC6C4TGdaesQQQ2plHVgYH9iWtCZowW1cRWrfeFabMqtAzCjVidzC30X+xv CpmjfuJNmbaZIF1/NmqYlm/UxUBRZ8/eBCCf5YHB8o3jcBSvbEk3kkCilGTsnRo4Fp7z p7pJ/suKDwsQDETDjvKOxU/SngsWEycyHTsdCzq2yr8hWWAJRCvDnnVBXGcdVVXI8fJG 4sDnQHVL/mCO+YFHctSlYsB86jysZfmmKbnY111GQIF2IGmGc3Tb+trOgE1oZJZJ7eFq tXxn8YLnErL9bcoQhLPtx+ALCZJCGec0CH364MXxesPlRPu9kBfZUWkklkLsOCcxxOtd gmZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=nl4/hS4VO/xDdkkV5qlHSP/CSafLdl6mm7fanExUM00=; fh=vzu4N/2bQ935L8afgPSM9lExt7+xxv+LGh8guf0KM30=; b=JUF/4e6ubr+WOQLPH+LU0nkztKd3LZZw9A3sTLO3h260uqOuQlFcR3UTH7v00E6o5v mburBerDeo6lkiTpADPJfKHUHx9SQwF0AEzYSTnWafFqAug0U5oqinklvZHxJsDB2Fyz q+Fdr2XcVldj+Iu72J2UYlzje5zRrDT5cVhWMf/+/JEdHwI9p3aVgJSdpJXL78YIc1sN QVNo6fx3pIUqTeYC15laXv5eDxJgVtC07kM/xcW8P4hW240dms7jeCB6ezgBR2kz7c2b qGqwxrruVejBVa0cp1/qUaIiSBxi91SSt2ZIbZk+vic51/D6GiVcTzBt5remaV+zVY1L 3m5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n19-20020a67f113000000b0046567d19c46si2230729vsk.500.2023.12.13.05.03.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:03:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDOrv-0008FE-A8; Wed, 13 Dec 2023 08:01:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDOrT-00084i-Hj; Wed, 13 Dec 2023 08:01:18 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDOrQ-0006yu-RC; Wed, 13 Dec 2023 08:01:15 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3199E3B43A; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id CAF893C8CB; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024714 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Michael Tokarev Subject: [Stable-7.2.8 07/24] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility Date: Wed, 13 Dec 2023 16:00:16 +0300 Message-Id: <20231213130041.1024630-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé assertRegexpMatches() has been removed in Python 3.12 and should be replaced by assertRegex(). See: https://docs.python.org/3.12/whatsnew/3.12.html#id3 Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231114144832.71612-1-philmd@linaro.org> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth (cherry picked from commit f0a663b4ced2bf315936c774c2b6ff398fce8905) Signed-off-by: Michael Tokarev (Mjt: adjust context for before v8.1.0-1582-g684750ab4f "python/qemu: rename command() to cmd()") diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 8cad156aa0..98c26ecf18 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -990,7 +990,7 @@ class. Here's a simple usage example: self.vm.launch() res = self.vm.command('human-monitor-command', command_line='info version') - self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') + self.assertRegex(res, r'^(\d+\.\d+\.\d)') To execute your test, run: diff --git a/tests/avocado/version.py b/tests/avocado/version.py index ded7f039c1..5f88ff300b 100644 --- a/tests/avocado/version.py +++ b/tests/avocado/version.py @@ -21,4 +21,4 @@ def test_qmp_human_info_version(self): self.vm.launch() res = self.vm.command('human-monitor-command', command_line='info version') - self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') + self.assertRegex(res, r'^(\d+\.\d+\.\d)')