def _check_import_error(self, script_name, msg): msg = re.escape(msg) self.assertRaisesRegexp(ImportError, msg, run_path, script_name)