From 6936f4626c8748c077ad2c63827d4deeb43b867d Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 18 Dec 2014 13:37:56 +0000 Subject: [PATCH] tests: Get misc/print_exception and pyb/spi working on pyboard. --- tests/misc/print_exception.py | 5 ++++- tests/pyb/spi.py.exp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/misc/print_exception.py b/tests/misc/print_exception.py index ba99ed48ba..e65b8d1ac5 100644 --- a/tests/misc/print_exception.py +++ b/tests/misc/print_exception.py @@ -14,8 +14,11 @@ except Exception as e: print_exception(e, buf) s = buf.getvalue() for l in s.split("\n"): + # uPy on pyboard prints as file, so remove filename. + if l.startswith(" File "): + print(l[:8], l[-23:]) # uPy and CPy tracebacks differ in that CPy prints a source line for # each traceback entry. In this case, we know that offending line # has 4-space indent, so filter it out. - if not l.startswith(" "): + elif not l.startswith(" "): print(l) diff --git a/tests/pyb/spi.py.exp b/tests/pyb/spi.py.exp index 68ebbcafb6..9a557da79b 100644 --- a/tests/pyb/spi.py.exp +++ b/tests/pyb/spi.py.exp @@ -1,5 +1,5 @@ SPI(1) -SPI(1, SPI.MASTER, baudrate=328125, polarity=1, phase=0, bits=8) +SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8) SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) b'\xff' b'\xff'