Make weave tests behave

This PR adds an additional commit to @rgommer's https://github.com/scipy/scipy/pull/3182