feat: 10865 fix v2 for codecov
This commit is contained in:
parent
9c4ffb5207
commit
48ded39b77
|
@ -332,7 +332,10 @@ class WarningsChecker(WarningsRecorder):
|
||||||
# Check warnings has valid argument type (#10865).
|
# Check warnings has valid argument type (#10865).
|
||||||
wrn: warnings.WarningMessage
|
wrn: warnings.WarningMessage
|
||||||
for wrn in self:
|
for wrn in self:
|
||||||
if isinstance(wrn.message, Warning):
|
self._validate_message(wrn)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _validate_message(wrn: Any) -> None:
|
||||||
if not isinstance(msg := wrn.message.args[0], str):
|
if not isinstance(msg := wrn.message.args[0], str):
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
f"Warning message must be str, got {msg!r} (type {type(msg).__name__})"
|
f"Warning message must be str, got {msg!r} (type {type(msg).__name__})"
|
||||||
|
|
Loading…
Reference in New Issue