From 750d3e5eccdbd1c5d4605690adc651cb29ddcf2b Mon Sep 17 00:00:00 2001 From: micbou Date: Sun, 10 Sep 2017 11:59:43 +0200 Subject: [PATCH] Run flake8 and nose as modules Running flake8 and nose as modules in run_tests.py make sure that we start these tools with the same Python as the one executing the script. --- run_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/run_tests.py b/run_tests.py index 0498a833..d07f708b 100755 --- a/run_tests.py +++ b/run_tests.py @@ -38,7 +38,9 @@ import argparse def RunFlake8(): print( 'Running flake8' ) subprocess.check_call( [ - 'flake8', + sys.executable, + # __main__ is required on Python 2.6. + '-m', 'flake8.__main__', p.join( DIR_OF_THIS_SCRIPT, 'python' ) ] ) @@ -84,7 +86,9 @@ def NoseTests( parsed_args, extra_nosetests_args ): else: nosetests_args.append( p.join( DIR_OF_THIS_SCRIPT, 'python' ) ) - subprocess.check_call( [ 'nosetests' ] + nosetests_args ) + subprocess.check_call( [ sys.executable, + # __main__ is required on Python 2.6. + '-m', 'nose.__main__' ] + nosetests_args ) def Main():