Replace deprecated assertRaisesRegexp

The assertRaisesRegexp method has been deprecated since it was renamed
to assertRaisesRegex in Python 3.2.

https://docs.python.org/3/library/unittest.html#deprecated-aliases

Change-Id: I38ed4bebee3617267463d13d8f12bc083ab74ac2
This commit is contained in:
wu.shiming 2021-11-08 14:34:35 +08:00
parent 12035a7049
commit b218b29c38

View File

@ -70,8 +70,8 @@ class TestFilters(unittest.TestCase):
def test_extract_duplicate_cell(self):
test_data = os.path.join(os.path.dirname(
__file__), 'data', 'nova_manage_cli_output_duplicate_cells')
self.assertRaisesRegexp(jinja2.TemplateRuntimeError, 'duplicates',
self._test_extract_cell, test_data, 'cell0001')
self.assertRaisesRegex(jinja2.TemplateRuntimeError, 'duplicates',
self._test_extract_cell, test_data, 'cell0001')
def test_namespace_haproxy_for_cell_with_empty_name(self):
example_services = {