Make mypy as strict as practical #13
3 changed files with 3 additions and 9 deletions
Enable "warn_unreachable"
Also, remove the dead `isinstance()` check in `Location.relate_to()`
commit
784d5c8ca0
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue