tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility
PATCH 1/1 tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility
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 <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- docs/devel/testing.rst | 2 +- tests/avocado/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
docs/devel/testing.rst +1 -1
@@ -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:
tests/avocado/version.py +1 -1
@@ -22,4 +22,4 @@ def test_qmp_human_info_version(self): 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)')
Signature · 1 line
2.41.0
Quoted 28 lines · Philippe Mathieu-Daudé
assertRegexpMatches()has been removed in Python 3.12 and should be replaced byassertRegex(). See: https://docs.python.org/3.12/whatsnew/3.12.html#id3Inspired-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- docs/devel/testing.rst | 2 +- tests/avocado/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)docs/devel/testing.rst +1
-1@@ -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:tests/avocado/version.py +0
-0
tests/avocado/version.py def test_qmp_human_info_version(self): · line 25
Quoted 5 lines
tests/avocado/version.py +1
-1@@ -22,4 +22,4 @@ def test_qmp_human_info_version(self): 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)')
Reviewed-by Thomas Huth <[email protected]>