diff --git a/pyproject.toml b/pyproject.toml index 6f7ab42..6a4752d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -486,6 +486,9 @@ warn_redundant_casts = true # Report functions returning `Any` despite a non-`Any` return type warn_return_any = true +# Report code that can never be reached +warn_unreachable = true + # Report "[[tool.mypy.overrides]]" sections that match no module warn_unused_configs = true diff --git a/src/velofy/db/utils/locations.py b/src/velofy/db/utils/locations.py index e5ba650..8b95cba 100644 --- a/src/velofy/db/utils/locations.py +++ b/src/velofy/db/utils/locations.py @@ -144,10 +144,6 @@ class Location: msg = "the `other` origin may only be set once" raise RuntimeError(msg) - if not isinstance(other, Location): - msg = "`other` is not a `Location` object" - raise TypeError(msg) - if self.zone != other.zone: msg = "`other` must be in the same zone, including the band" raise ValueError(msg) diff --git a/tests/db/utils/test_locations.py b/tests/db/utils/test_locations.py index 8257652..ff9eefc 100644 --- a/tests/db/utils/test_locations.py +++ b/tests/db/utils/test_locations.py @@ -169,11 +169,6 @@ class TestRelateTo: with pytest.raises(RuntimeError, match="once"): location.relate_to(origin) - def test_call_relate_to_with_wrong_other_type(self, location): - """`other` must be another `Location`.""" - with pytest.raises(TypeError, match="Location"): - location.relate_to(object()) - def test_call_relate_to_with_far_away_other( self, location,