From 861f724d03e1748cda1c5b9ec8457a368590cbd5 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 14 Nov 2023 14:43:26 +0100 Subject: tests/avocado: Replace assertEquals() for Python 3.12 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit assertEquals() has been removed in Python 3.12 and should be replaced by assertEqual(). See: https://docs.python.org/3.12/whatsnew/3.12.html#id3 Message-ID: <20231114134326.287242-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- docs/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index fef64ac..87ed30a 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -1077,7 +1077,7 @@ and hypothetical example follows: 'human-monitor-command', command_line='info version') - self.assertEquals(first_res, second_res, third_res) + self.assertEqual(first_res, second_res, third_res) At test "tear down", ``avocado_qemu.Test`` handles all the QEMUMachines shutdown. -- cgit v1.1 From f0a663b4ced2bf315936c774c2b6ff398fce8905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 14 Nov 2023 15:48:31 +0100 Subject: tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 87ed30a..22218db 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.cmd('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: -- cgit v1.1