Skip to content

Commit

Permalink
[pylint] Noqa a false positive with dynamic exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Mar 3, 2025
1 parent 410a052 commit be2600e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ def validate_exc(exc: type[E]) -> type[E]:
raise TypeError(f"{func!r} object (type: {type(func)}) must be callable")
try:
func(*args[1:], **kwargs)
except expected_exceptions as e:
except expected_exceptions as e: # pylint: disable=catching-non-exception
return _pytest._code.ExceptionInfo.from_exception(e)
fail(message)

Expand Down

0 comments on commit be2600e

Please sign in to comment.