|
26 | 26 | CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3')
|
27 | 27 | MICROPYTHON = os.getenv('MICROPY_MICROPYTHON', base_path('../ports/unix/micropython'))
|
28 | 28 |
|
| 29 | +# Use CPython options to not save .pyc files, to only access the core standard library |
| 30 | +# (not site packages which may clash with u-module names), and improve start up time. |
| 31 | +CPYTHON3_CMD = [CPYTHON3, "-BS"] |
| 32 | + |
29 | 33 | # mpy-cross is only needed if --via-mpy command-line arg is passed
|
30 | 34 | MPYCROSS = os.getenv('MICROPY_MPYCROSS', base_path('../mpy-cross/mpy-cross'))
|
31 | 35 |
|
@@ -319,7 +323,7 @@ def run_tests(pyb, tests, args, result_dir):
|
319 | 323 | upy_float_precision = int(upy_float_precision)
|
320 | 324 | has_complex = run_feature_check(pyb, args, base_path, 'complex.py') == b'complex\n'
|
321 | 325 | has_coverage = run_feature_check(pyb, args, base_path, 'coverage.py') == b'coverage\n'
|
322 |
| - cpy_byteorder = subprocess.check_output([CPYTHON3, base_path('feature_check/byteorder.py')]) |
| 326 | + cpy_byteorder = subprocess.check_output(CPYTHON3_CMD + [base_path('feature_check/byteorder.py')]) |
323 | 327 | skip_endian = (upy_byteorder != cpy_byteorder)
|
324 | 328 |
|
325 | 329 | # These tests don't test slice explicitly but rather use it to perform the test
|
@@ -498,7 +502,7 @@ def run_tests(pyb, tests, args, result_dir):
|
498 | 502 | else:
|
499 | 503 | # run CPython to work out expected output
|
500 | 504 | try:
|
501 |
| - output_expected = subprocess.check_output([CPYTHON3, '-B', test_file]) |
| 505 | + output_expected = subprocess.check_output(CPYTHON3_CMD + [test_file]) |
502 | 506 | if args.write_exp:
|
503 | 507 | with open(test_file_expected, 'wb') as f:
|
504 | 508 | f.write(output_expected)
|
|
0 commit comments