From patchwork Tue Dec 12 12:17:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753050 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1868025wrs; Tue, 12 Dec 2023 04:21:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6VoSowLYR6/KcI7syTaUqY4Pm7S64P4rDimi/G9CuiU0e+icAEeuaSgXbEI1QVAtli6oQ X-Received: by 2002:ad4:4192:0:b0:67a:a721:9ecd with SMTP id e18-20020ad44192000000b0067aa7219ecdmr6521305qvp.126.1702383674387; Tue, 12 Dec 2023 04:21:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383674; cv=none; d=google.com; s=arc-20160816; b=SWuqtHr3sSObGcpXK0jlf6uNBeWRp9WGW6VkibTvoqrqYjjBSUUhK4vAqUNYEbNHMP z7VBHG844Vt5MBL+u7q7IUF4CgpVY/qKb9fGiUKAshu7ZCgyG6148eqHayoycWMSzmeL b9zbN5K5BSff31NoAlZY4l08evBadB1s26Qk0lI4xOrtbynJa6JObuU8RcwK5UNoS/QK PMMogBmPFanPxuYGJgSdk/EFZECsCnSVN0GQh64A1WOshAkorwVBO/2E83g6IxPma4Nx lub7o/D15ZrpX0o2nbZJlrhT1fjJzHO6DBdJ6FGIJTuqhllBX6u1GdKEKhVwDJ3F2wYw wp8w== 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=3+bzWOgNnueb5anAbc10l7+86QpesrwIeE4Ka8ZrR4g=; fh=vzu4N/2bQ935L8afgPSM9lExt7+xxv+LGh8guf0KM30=; b=f1RNs1eATdWXcDSVBvHd4YNhfgBGOHiqdZ0TPJ5iZg0Sy9RsWvnP/YH4RDY7neb7wF vvD4QhiuqcjGMRGonDZkh1Ud1WQWfJaFpQIyZ/LNtHOAe/c1ZY+QNOjlrPtBF6DCZHlM 56edLr764LPxyk6YPdZ4T/83/np4G43dT90OjxDTxhoRObAtMm/C//Ng7che6zHHNwVB ve3RSCw5bk7bXPmMc3PpKWdHXla7yO6M9dEAfci2UW03MvKD5j4jWvGShxtuVtCtgDsn RXJ6j4O6XtXOgSr8lZQ4rFehnyKnwniQFWprx8MJJYd21JB/IrdqT0IWS1lHQxNiOxI+ yKng== 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 q3-20020ad45743000000b0067a391a13e8si247281qvx.80.2023.12.12.04.21.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:21:14 -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 1rD1jP-0005Fr-MR; Tue, 12 Dec 2023 07:19:23 -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 1rD1jN-0005ET-NF; Tue, 12 Dec 2023 07:19:21 -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 1rD1jM-0000Kl-0b; Tue, 12 Dec 2023 07:19:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5254A3AEFC; Tue, 12 Dec 2023 15:18:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1861E3B94A; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003422 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -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-8.1.4 08/31] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility Date: Tue, 12 Dec 2023 15:17:56 +0300 Message-Id: <20231212121831.1003318-8-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 1c4ee2af32..1502fc01f2 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -1016,7 +1016,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 dd775955eb..1d5f1f2562 100644 --- a/tests/avocado/version.py +++ b/tests/avocado/version.py @@ -22,4 +22,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)')