Check for attr __name__ before trying to access it

    In order for freeze gun to play well with py.test
Merge pull request #18 from PuercoPop/master

Fix for py.test