From 109b33f64c8d3f48c9e0bd3ea8d42fe6f3cb02b7 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 19 Jan 2017 21:10:33 -0500 Subject: Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2. --- tests/utils_tests/test_module_loading.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/utils_tests/test_module_loading.py') diff --git a/tests/utils_tests/test_module_loading.py b/tests/utils_tests/test_module_loading.py index e979b3e7ba..8e6806e8d5 100644 --- a/tests/utils_tests/test_module_loading.py +++ b/tests/utils_tests/test_module_loading.py @@ -146,11 +146,11 @@ class AutodiscoverModulesTestCase(SimpleTestCase): autodiscover_modules('missing_module') def test_autodiscover_modules_found_but_bad_module(self): - with self.assertRaisesRegex(ImportError, "No module named '?a_package_name_that_does_not_exist'?"): + with self.assertRaisesMessage(ImportError, "No module named 'a_package_name_that_does_not_exist'"): autodiscover_modules('bad_module') def test_autodiscover_modules_several_one_bad_module(self): - with self.assertRaisesRegex(ImportError, "No module named '?a_package_name_that_does_not_exist'?"): + with self.assertRaisesMessage(ImportError, "No module named 'a_package_name_that_does_not_exist'"): autodiscover_modules('good_module', 'bad_module') def test_autodiscover_modules_several_found(self): -- cgit v1.3