From b5e0eb0985fdd0e7ae02fe1d55027fe3a05199f2 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 22 Feb 2017 12:04:09 -0800 Subject: [PATCH] Fixes for missing aliases files sanity test. (#21798) * Refine test for missing aliases files. * Fix formatting of missing aliases message. --- test/sanity/code-smell/integration-aliases.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)