Python: Added debug mode for test method