Skip to content

Commit 5715ba7

Browse files
committed
TST: Show error on EW for Latitude or NS for Longitude
1 parent eb9ab35 commit 5715ba7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

astropy/coordinates/tests/test_angles.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,18 @@ def test_lon_as_lat():
777777
assert lat.value[0] == 10.0
778778

779779

780+
@pytest.mark.parametrize("lon", ["12.3dW", "12h13m12sE"])
781+
def test_lon_as_lat_str(lon):
782+
with pytest.raises(TypeError, match="Latitude.*cannot be created from a Longitude"):
783+
Latitude(lon)
784+
785+
786+
@pytest.mark.parametrize("lat", ["12.3dN", "12d13m12sS"])
787+
def test_lat_as_lon_str(lat):
788+
with pytest.raises(TypeError, match="Longitude.*cannot be created from a Latitude"):
789+
Longitude(lat)
790+
791+
780792
def test_longitude():
781793
"""Test setting and manipulation operations on Longitude angles."""
782794

0 commit comments

Comments
 (0)