Fix tests raising DeprecationWarning.

It turns out nose doesn't run test files which are executable, hence
these haven't been run in a while and starting causing
DeprecationWarning; this fixes this and hence gets them passing
again.