channel output in console test suite unittest

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

channel output in console test suite unittest

Post by teobo »

Hi,
do not know, if this is rather a python question or freecad one as I need it for a freecad macro.

Consider for example this line in a tested or Test-function:

Code: Select all

Import.export([FreeCAD.activeDocument().getObject(compound.Name)], step1)
It makes some noise like this on the console:
Reading STEP file......
Now I do not know how to handle this console streams, at all. What would be a best practice to have it logged and how to keep the the console free, when I trigger the unittest from the command line often.
such as

Code: Select all

python -m unittest Testpointtopost.ReportTestCase.test_prepares_csv_visu_from_step_filelist
Practiced a little python logging, but am unsure to fit in the fc-system. Is logging needed? How?
Tia
Post Reply