Fix tests that use skip_if

This commit is contained in:
Jeff Epler 2023-10-02 07:24:47 -05:00
parent 6d59e55599
commit ac64e6d807
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
2 changed files with 3 additions and 1 deletions

View File

@ -712,9 +712,11 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
with open(test_file_expected, "rb") as f:
output_expected = f.read()
else:
# CIRCUITPY: set language & make sure testlib is available for `skip_ok`.
e = {"PYTHONPATH": "testlib", "PATH": os.environ["PATH"], "LANG": "en_US.UTF-8"}
# run CPython to work out expected output
try:
output_expected = subprocess.check_output(CPYTHON3_CMD + [test_file])
output_expected = subprocess.check_output(CPYTHON3_CMD + [test_file], env=e)
if args.write_exp:
with open(test_file_expected, "wb") as f:
f.write(output_expected)