This PR fixes up some test failures when running with numpy-1.17.0rc1, see astropy/astropy#8976.
numpy-1.17.0rc1