From 618ef9db661d5562f4437dce3282567b778210a9 Mon Sep 17 00:00:00 2001 From: pdthummar Date: Fri, 1 Apr 2022 16:20:20 -0500 Subject: [PATCH] updated and tested the verbiage of 'ModuleNotFound' error. --- azure_functions_worker/loader.py | 4 +++- tests/unittests/test_http_functions.py | 4 +++- tests/unittests/test_loader.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/azure_functions_worker/loader.py b/azure_functions_worker/loader.py index 672ef60a1..2dd260654 100644 --- a/azure_functions_worker/loader.py +++ b/azure_functions_worker/loader.py @@ -46,7 +46,9 @@ def uninstall() -> None: @attach_message_to_exception( expt_type=ImportError, - message=f'Troubleshooting Guide: {MODULE_NOT_FOUND_TS_URL}' + message=f'Please check the requirements.txt file for the missing module. ' + f'For more info, please refer the troubleshooting' + f' guide: {MODULE_NOT_FOUND_TS_URL} ' ) def load_function(name: str, directory: str, script_file: str, entry_point: typing.Optional[str]): diff --git a/tests/unittests/test_http_functions.py b/tests/unittests/test_http_functions.py index 2e65a3108..3b2fe8c00 100644 --- a/tests/unittests/test_http_functions.py +++ b/tests/unittests/test_http_functions.py @@ -321,7 +321,9 @@ def check_log_import_module_troubleshooting_url(self, host_out: typing.List[str]): self.assertIn("Exception: ModuleNotFoundError: " "No module named 'does_not_exist'. " - "Troubleshooting Guide: " + "Please check the requirements.txt file for the " + "missing module. For more info, please refer the " + "troubleshooting guide: " "https://aka.ms/functions-modulenotfound", host_out) @pytest.mark.flaky(reruns=3) diff --git a/tests/unittests/test_loader.py b/tests/unittests/test_loader.py index 5eff64d06..074bcc7e5 100644 --- a/tests/unittests/test_loader.py +++ b/tests/unittests/test_loader.py @@ -128,7 +128,9 @@ def test_loader_outside_main_package_should_be_loaded_from_package(self): def check_log_loader_module_not_found(self, host_out): self.assertIn("Exception: ModuleNotFoundError: " "No module named 'notfound'. " - "Troubleshooting Guide: " + "Please check the requirements.txt file for the " + "missing module. For more info, please refer the " + "troubleshooting guide: " "https://aka.ms/functions-modulenotfound", host_out)