Page 1 of 1

Unit Testing - Squelching Print Statements

Posted: Fri Apr 06, 2018 12:47 am
by semireg
I'm running unit tests within the unix port and some functions generate output via print. Is there a way to temporarily disable standard output from within the micropython environment, or redirect one output to another? I see sys.stderr and sys.stdout but it's not obvious how to manipulate them.

Re: Unit Testing - Squelching Print Statements

Posted: Fri Apr 06, 2018 5:31 am
by pythoncoder
Is print(data, file=f) any help?

Re: Unit Testing - Squelching Print Statements

Posted: Tue Jul 10, 2018 7:17 pm
by jickster
pythoncoder wrote:
Fri Apr 06, 2018 5:31 am
Is print(data, file=f) any help?
What if print is called internally?
jickster wrote:
Tue Jul 10, 2018 7:15 pm
This was a question in another thread
LisaM wrote:
Wed Nov 08, 2017 6:05 pm
But... Help("modules") does show a list of frozen modules so the info is available in micropython (at least on esp32). Is there a way of redirecting the help output into a string for parsing (again on a esp32)?
but it definitely is a thread itself.