Move test into tests directory
Replace astropy raises with pytest.raises