Enable "warn_unreachable"

Also, remove the dead `isinstance()` check in `Location.relate_to()`
This commit is contained in:
Alexander Hess 2026-12-01 13:02:57 +01:00
commit 784d5c8ca0
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
3 changed files with 3 additions and 9 deletions

View file

@ -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

View file

@ -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)

View file

@ -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,