[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.8 07/24] tests/avocado: Replace assertRegexpMatches() for Py
From: |
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 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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 <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231114144832.71612-1-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit f0a663b4ced2bf315936c774c2b6ff398fce8905)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(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)')
--
2.39.2
- [Stable-7.2.8 00/24] Patch Round-up for stable 7.2.8, freeze on 2023-12-23, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 01/24] target/arm: Fix SME FMOPA (16-bit), BFMOPA, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 06/24] tests/avocado: Replace assertEquals() for Python 3.12 compatibility, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 08/24] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 02/24] hw/ide/ahci: fix legacy software reset, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 04/24] net: Update MemReentrancyGuard for NIC, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 05/24] linux-user: Fix loaddr computation for some elf files, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 03/24] net: Provide MemReentrancyGuard * to qemu_new_nic(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 07/24] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility,
Michael Tokarev <=
- [Stable-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 09/24] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 10/24] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 11/24] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 13/24] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 15/24] hw/mips/malta: Fix the malta machine on big endian hosts, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 14/24] vmdk: Don't corrupt desc file in vmdk_write_cid, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 18/24] hw/acpi/erst: Do not ignore Error* in realize handler, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 16/24] hw/audio/hda-codec: fix multiplication overflow, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 21/24] ui/gtk-egl: move function calls back to regular code path, Michael Tokarev, 2023/12/13