1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

filter weird characters from esp output to python (#6226)

(this is an issue probably since we switched from esptool.exe to esptool.py)
This commit is contained in:
david gauchard
2019-06-25 21:45:33 +02:00
committed by Earle F. Philhower, III
parent 80e976d1f0
commit 7c184f4268
2 changed files with 12 additions and 5 deletions

View File

@ -29,6 +29,7 @@ except:
import mock_decorators
debug = False
#debug = True
sys.path.append(os.path.abspath(__file__))
@ -126,7 +127,7 @@ class BSTestRunner(object):
debug_print('test output was:')
debug_print(test_output.getvalue())
if result == BSTestRunner.SUCCESS:
test_case.stdout = test_output.getvalue()
test_case.stdout = filter(lambda c: ord(c) < 128, test_output.getvalue())
print('test "{}" passed'.format(name))
else:
print('test "{}" failed'.format(name))
@ -269,7 +270,7 @@ def main():
ts = run_tests(sp, name, mocks, env_vars)
if args.output:
with open(args.output, "w") as f:
TestSuite.to_file(f, [ts])
TestSuite.to_file(f, [ts], encoding='raw_unicode_escape')
return 0
if __name__ == '__main__':