From e21791a8b761a561ba5615340c319292917fbeff Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 12 Oct 2018 14:24:03 -0400 Subject: [PATCH] Ignore coverage of repr / base class methods --- monads/applicative.py | 4 ++-- monads/functor.py | 2 +- monads/maybe.py | 10 +++++----- monads/monad.py | 2 +- monads/monoid.py | 4 ++-- monads/result.py | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/monads/applicative.py b/monads/applicative.py index 3f7edd8..9bf351a 100644 --- a/monads/applicative.py +++ b/monads/applicative.py @@ -9,12 +9,12 @@ S = TypeVar("S") class Applicative(Functor[T]): @classmethod - def pure(cls, value: T) -> Applicative[T]: + def pure(cls, value: T) -> Applicative[T]: # pragma: no cover raise NotImplementedError # FIXME: Functor type set to Any, as the proper value # (Functor[Callable[[T], S]]) is reported as incompatible with subclass # implementations due to a flaw in mypy: # https://github.com/python/mypy/issues/1317 - def apply(self, functor: Any) -> Functor[S]: + def apply(self, functor: Any) -> Functor[S]: # pragma: no cover raise NotImplementedError diff --git a/monads/functor.py b/monads/functor.py index b662cb6..6634698 100644 --- a/monads/functor.py +++ b/monads/functor.py @@ -6,5 +6,5 @@ S = TypeVar("S") class Functor(Generic[T]): - def map(self, function: Callable[[T], S]) -> Functor[S]: + def map(self, function: Callable[[T], S]) -> Functor[S]: # pragma: no cover raise NotImplementedError diff --git a/monads/maybe.py b/monads/maybe.py index 0f3e8dd..699a4ba 100644 --- a/monads/maybe.py +++ b/monads/maybe.py @@ -9,7 +9,7 @@ E = TypeVar("E") class Maybe(Monad[T]): - def __init__(self) -> None: + def __init__(self) -> None: # pragma: no cover raise NotImplementedError @classmethod @@ -54,7 +54,7 @@ class Just(Maybe[T]): def __eq__(self, other: object): return isinstance(other, Just) and self.value == other.value - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return f"" @@ -65,7 +65,7 @@ class Nothing(Maybe[T]): def __eq__(self, other: object): return isinstance(other, Nothing) - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return "" @@ -88,7 +88,7 @@ class First(Monoid[Maybe[T]]): else: return other - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return f"" __add__ = mappend @@ -109,7 +109,7 @@ class Last(Monoid[Maybe[T]]): else: return self - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return f"" __add__ = mappend diff --git a/monads/monad.py b/monads/monad.py index 72ed11c..adcd7ea 100644 --- a/monads/monad.py +++ b/monads/monad.py @@ -13,5 +13,5 @@ class Monad(Applicative[T]): # (Monad[S]) is reported as incompatible with subclass # implementations due to a flaw in mypy: # https://github.com/python/mypy/issues/1317 - def bind(self, function: Callable[[T], Any]) -> Monad[S]: + def bind(self, function: Callable[[T], Any]) -> Monad[S]: # pragma: no cover raise NotImplementedError diff --git a/monads/monoid.py b/monads/monoid.py index 6cc24f6..a9d3b5a 100644 --- a/monads/monoid.py +++ b/monads/monoid.py @@ -13,11 +13,11 @@ class Monoid(Generic[T]): # FIXME: Other type set to Any, as the proper value (Monoid[T]) is # reported as incompatible with subclass implementations due to a # flaw in mypy: https://github.com/python/mypy/issues/1317 - def mappend(self, other: Any) -> Monoid[T]: + def mappend(self, other: Any) -> Monoid[T]: # pragma: no cover raise NotImplementedError @classmethod - def mzero(cls) -> Monoid[T]: + def mzero(cls) -> Monoid[T]: # pragma: no cover raise NotImplementedError @classmethod diff --git a/monads/result.py b/monads/result.py index ac06def..b9ab238 100644 --- a/monads/result.py +++ b/monads/result.py @@ -16,7 +16,7 @@ class Monad(Generic[T]): class Result(Monad[T], Generic[T, E]): - def __init__(self) -> None: + def __init__(self) -> None: # pragma: no cover raise NotImplementedError @classmethod @@ -67,7 +67,7 @@ class Ok(Result[T, E]): def __eq__(self, other: object): return isinstance(other, Ok) and self.value == other.value - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return f"" @@ -78,7 +78,7 @@ class Err(Result[T, E]): def __eq__(self, other: object): return isinstance(other, Err) and self.err == other.err - def __repr__(self) -> str: + def __repr__(self) -> str: # pragma: no cover return f""