This fixes the issue for me, though it requires monkey-patching an internal function in py.test :(  I'll see if we can get this fixed upstream and then when we next upgrade py.test we can take this out.
Adds a little more detailed explanation about what this patch is and why it's here.
Also this should be a new-style class
Merge pull request #811 from iguananaut/issue-811

astropy 0.2 tests write to site-packages for Python 3