Ignore coverage on unreachable code branches

These code branches should be unreachable in type-safe code.
This commit is contained in:
Correl Roush 2018-10-12 14:55:19 -04:00
parent 711571d807
commit 8c18de5e6f

View file

@ -22,7 +22,7 @@ class Result(Monad[T], Generic[T, E]):
elif isinstance(self, Err):
new: Result[S, E] = Err(self.err)
return new
else:
else: # pragma: no cover
raise TypeError
def map(self, function: Callable[[T], S]) -> Result[S, E]:
@ -31,7 +31,7 @@ class Result(Monad[T], Generic[T, E]):
elif isinstance(self, Err):
new: Result[S, E] = Err(self.err)
return new
else:
else: # pragma: no cover
raise TypeError
def apply(self, functor: Result[Callable[[T], S], E]) -> Result[S, E]:
@ -40,7 +40,7 @@ class Result(Monad[T], Generic[T, E]):
elif isinstance(functor, Err):
new: Result[S, E] = Err(functor.err)
return new
else:
else: # pragma: no cover
raise TypeError
def withDefault(self, default: T) -> T: