Skip to content

Commit c5d5786

Browse files
committed
Configure coverage to ignore unreachable typing code
1 parent 83f1a89 commit c5d5786

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,15 @@ source = pluggy/
1212
*/lib/python*/site-packages/pluggy/
1313
*/pypy*/site-packages/pluggy/
1414
*\Lib\site-packages\pluggy\
15+
16+
[report]
17+
exclude_lines =
18+
# Have to re-enable the standard pragma
19+
pragma: no cover
20+
21+
if TYPE_CHECKING:
22+
23+
if __name__ == .__main__.:
24+
25+
# Ignore coverage on lines solely with `...`
26+
^\s*\.\.\.\s*$

src/pluggy/_hooks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __call__(
6969
historic: bool = False,
7070
warn_on_impl: Optional[Warning] = None,
7171
) -> _F:
72-
pass
72+
...
7373

7474
@overload # noqa: F811
7575
def __call__( # noqa: F811
@@ -79,7 +79,7 @@ def __call__( # noqa: F811
7979
historic: bool = ...,
8080
warn_on_impl: Optional[Warning] = ...,
8181
) -> Callable[[_F], _F]:
82-
pass
82+
...
8383

8484
def __call__( # noqa: F811
8585
self,
@@ -140,7 +140,7 @@ def __call__(
140140
trylast: bool = ...,
141141
specname: Optional[str] = ...,
142142
) -> _F:
143-
pass
143+
...
144144

145145
@overload # noqa: F811
146146
def __call__( # noqa: F811
@@ -152,7 +152,7 @@ def __call__( # noqa: F811
152152
trylast: bool = ...,
153153
specname: Optional[str] = ...,
154154
) -> Callable[[_F], _F]:
155-
pass
155+
...
156156

157157
def __call__( # noqa: F811
158158
self,
@@ -270,7 +270,7 @@ class _HookRelay:
270270
if TYPE_CHECKING:
271271

272272
def __getattr__(self, name: str) -> "_HookCaller":
273-
pass
273+
...
274274

275275

276276
class _HookCaller:

0 commit comments

Comments
 (0)