"""Run Python's test suite in a fast, rigorous way. The defaults are meant to be thorough but to skip certain resources are not used (by default) which can consume a lot of time and resources (e.g., largefile) or can be distracting (e.g., audio and gui). These defaults can be overridden by simply passing arguments to this script. """ import os import sys def main(regrtest_args=['-u', 'all,-largefile,-audio,-gui']): args = [sys.executable, '-W', 'default', # Warnings set to 'default' '-bb', # Warnings about bytes/bytearray '-E', # Ignore environment variables '-m', 'test', # Run the test suite '-r', # Randomize test order '-w', # Re-run failed test in verbose mode '-j', '0' # Use all CPU cores ] args.extend(regrtest_args) print(' '.join(args)) os.execv(sys.executable, args) if __name__ == '__main__': if len(sys.argv) > 1: main(sys.argv[1:]) else: main()