Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for Python 3.5+ in test script #299

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Add check for Python 3.5+ in test script

The test script uses features introduced in Python 3.5 (namely
os.path.commonpath), but the shebang only specifies python3. Because
Python3.5 is fairly new, it's likely that python3 is not yet Python 3.5
(or later) for many people, so explicitly check for this.

This occured on Travis, requiring an explicit 'python: 3.5' config,
which is what spurred this commit.
  • Loading branch information
aneeshusa committed Apr 7, 2016
commit 702cae55268fa7ea123d0790773693e2991e43de
@@ -44,11 +44,17 @@ def run_tests(tests):


def main():
if sys.version_info < (3, 5): # We use features introduced in Python 3.5
sys.stderr.write('{}: Python 3.5 or later is needed for this script\n'
.format(__file__))
return 1

tests = ['lint'] # Only tests that are always safe and meaningful to run
if len(sys.argv) > 1:
tests = sys.argv[1:]

return run_tests(tests)


if __name__ == '__main__':
sys.exit(main())
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.