Skip to content

Commit d443764

Browse files
add no cover for special varnames cases
1 parent 6a417de commit d443764

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pluggy/_hooks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,20 @@ def varnames(func: object) -> tuple[tuple[str, ...], tuple[str, ...]]:
300300
if inspect.isclass(func):
301301
try:
302302
func = func.__init__
303-
except AttributeError:
303+
except AttributeError: # pragma: no cover - pypy special case
304304
return (), ()
305305
elif not inspect.isroutine(func): # callable object?
306306
try:
307307
func = getattr(func, "__call__", func)
308-
except Exception:
308+
except Exception: # pragma: no cover - pypy special case
309309
return (), ()
310310

311311
try:
312312
# func MUST be a function or method here or we won't parse any args.
313313
sig = inspect.signature(
314314
func.__func__ if inspect.ismethod(func) else func # type:ignore[arg-type]
315315
)
316-
except TypeError:
316+
except TypeError: # pragma: no cover
317317
return (), ()
318318

319319
_valid_param_kinds = (
@@ -345,7 +345,7 @@ def varnames(func: object) -> tuple[tuple[str, ...], tuple[str, ...]]:
345345
# pypy3 uses "obj" instead of "self" for default dunder methods
346346
if not _PYPY:
347347
implicit_names: tuple[str, ...] = ("self",)
348-
else:
348+
else: # pragma: no cover
349349
implicit_names = ("self", "obj")
350350
if args:
351351
qualname: str = getattr(func, "__qualname__", "")

0 commit comments

Comments
 (0)