test/py: drain console log at the end of any failed test