Loading a local image file causes my script to hang

Sorry to dash your hopes, but whichever method you use to write tests, you are programming.

That leads me to suggest you read the following to help us help you: