more flexible testing, fixed missing import in phpy due to capture.py rename