diff options
author | Ran Benita <ran@unusedvar.com> | 2020-08-14 13:35:34 +0300 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-08-14 13:54:46 +0300 |
commit | f28af14457396b2100160985d179aa42f3c1c313 (patch) | |
tree | e9a35033411ced195e300a711e83a7e1d74d4a53 /src/_pytest/pytester.py | |
parent | 2c5403b951e616b4d1a426c7f2c155164922ce13 (diff) | |
download | pytest-f28af14457396b2100160985d179aa42f3c1c313.tar.gz |
Don't use NotImplementedError in `@overload`s
We used it as a shortcut for avoiding coverage, but pylint has a special
interpretation of it as an abstract method which we don't want.
Diffstat (limited to 'src/_pytest/pytester.py')
-rw-r--r-- | src/_pytest/pytester.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 83c525fd8..5d8a45ad7 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -201,7 +201,7 @@ class ParsedCall: if TYPE_CHECKING: # The class has undetermined attributes, this tells mypy about it. def __getattr__(self, key: str): - raise NotImplementedError() + ... class HookRecorder: @@ -274,13 +274,13 @@ class HookRecorder: def getreports( self, names: "Literal['pytest_collectreport']", ) -> Sequence[CollectReport]: - raise NotImplementedError() + ... @overload # noqa: F811 def getreports( # noqa: F811 self, names: "Literal['pytest_runtest_logreport']", ) -> Sequence[TestReport]: - raise NotImplementedError() + ... @overload # noqa: F811 def getreports( # noqa: F811 @@ -290,7 +290,7 @@ class HookRecorder: "pytest_runtest_logreport", ), ) -> Sequence[Union[CollectReport, TestReport]]: - raise NotImplementedError() + ... def getreports( # noqa: F811 self, @@ -337,13 +337,13 @@ class HookRecorder: def getfailures( self, names: "Literal['pytest_collectreport']", ) -> Sequence[CollectReport]: - raise NotImplementedError() + ... @overload # noqa: F811 def getfailures( # noqa: F811 self, names: "Literal['pytest_runtest_logreport']", ) -> Sequence[TestReport]: - raise NotImplementedError() + ... @overload # noqa: F811 def getfailures( # noqa: F811 @@ -353,7 +353,7 @@ class HookRecorder: "pytest_runtest_logreport", ), ) -> Sequence[Union[CollectReport, TestReport]]: - raise NotImplementedError() + ... def getfailures( # noqa: F811 self, |