diff --git a/avocado/core/loader.py b/avocado/core/loader.py index 5ebc208daeb635028afaac1baaeeb1fd507990d6..5077a0d68b10511210e92c762a39102de6a53273 100644 --- a/avocado/core/loader.py +++ b/avocado/core/loader.py @@ -472,6 +472,8 @@ class FileLoader(TestLoader): """ name = 'file' + __not_test_str = (": Does not look like an INSTRUMENTED test, nor is " + "it executable") def __init__(self, args, extra_params): test_type = extra_params.pop('allowed_test_types', None) @@ -717,7 +719,8 @@ class FileLoader(TestLoader): else: # Module does not have an avocado test class inside, and # it's not executable. Not a Test. - return make_broken(NotATest, test_path) + return make_broken(NotATest, + test_path + self.__not_test_str) # Since a lot of things can happen here, the broad exception is # justified. The user will get it unadulterated anyway, and avocado @@ -730,7 +733,7 @@ class FileLoader(TestLoader): # execute it. return self._make_test(test.SimpleTest, test_path) else: - return make_broken(NotATest, test_path) + return make_broken(NotATest, test_path + self.__not_test_str) @staticmethod def _make_test(klass, uid): @@ -759,7 +762,8 @@ class FileLoader(TestLoader): test_name = test_path if os.path.exists(test_path): if os.access(test_path, os.R_OK) is False: - return make_broken(AccessDeniedPath, test_path) + return make_broken(AccessDeniedPath, test_path + ": Is not " + "readable") path_analyzer = path.PathInspector(test_path) if path_analyzer.is_python(): return self._make_avocado_tests(test_path, make_broken, @@ -769,14 +773,17 @@ class FileLoader(TestLoader): return self._make_test(test.SimpleTest, test_path) else: - return make_broken(NotATest, test_path) + return make_broken(NotATest, + test_path + self.__not_test_str) else: if os.path.islink(test_path): try: if not os.path.isfile(os.readlink(test_path)): - return make_broken(BrokenSymlink, test_path) + return make_broken(BrokenSymlink, test_path + ": Is " + "a broken symlink") except OSError: - return make_broken(AccessDeniedPath, test_path) + return make_broken(AccessDeniedPath, test_path + ": Is " + "not accessible.") # Try to resolve test ID (keep compatibility) test_path = os.path.join(data_dir.get_test_dir(), test_name) @@ -793,7 +800,7 @@ class FileLoader(TestLoader): return self._make_avocado_tests(test_path, make_broken, subtests_filter, test_name) - return make_broken(MissingTest, test_name) + return make_broken(NotATest, test_name + self.__not_test_str) class ExternalLoader(TestLoader):