diff --git a/test/sanity/code-smell/integration-aliases.py b/test/sanity/code-smell/integration-aliases.py index 980b120c229..045c2087600 100755 --- a/test/sanity/code-smell/integration-aliases.py +++ b/test/sanity/code-smell/integration-aliases.py @@ -22,7 +22,7 @@ def main(): continue # don't require aliases for support directories - if any(os.path.splitext(f)[0] == 'test' for f in files): + if any(os.path.splitext(f)[0] == 'test' and os.access(os.path.join(target_dir, f), os.X_OK) for f in files): continue # don't require aliases for setup_ directories @@ -41,7 +41,7 @@ def main(): missing_aliases.append(target_dir) if missing_aliases: - message = ''' + message = textwrap.dedent(''' The following integration target directories are missing `aliases` files: %s @@ -66,9 +66,9 @@ def main(): skip/python3 Take a look at existing `aliases` files to see what aliases are available and how they're used. - ''' % '\n'.join(missing_aliases) + ''').strip() % '\n'.join(missing_aliases) - print(textwrap.dedent(message).strip()) + print(message) exit(1)