(
stub: nodes.Decorator, runtime: MaybeMissing[Any], object_path: list[str]
)
| 1653 | |
| 1654 | @verify.register(nodes.Decorator) |
| 1655 | def verify_decorator( |
| 1656 | stub: nodes.Decorator, runtime: MaybeMissing[Any], object_path: list[str] |
| 1657 | ) -> Iterator[Error]: |
| 1658 | if stub.func.is_type_check_only: |
| 1659 | # This function only exists in stubs, we only check that the runtime part |
| 1660 | # is missing. Other checks are not required. |
| 1661 | if not isinstance(runtime, Missing): |
| 1662 | yield Error( |
| 1663 | object_path, |
| 1664 | 'is marked as "@type_check_only", but also exists at runtime', |
| 1665 | stub, |
| 1666 | runtime, |
| 1667 | stub_desc=repr(stub), |
| 1668 | ) |
| 1669 | return |
| 1670 | |
| 1671 | if isinstance(runtime, Missing): |
| 1672 | yield Error(object_path, "is not present at runtime", stub, runtime) |
| 1673 | return |
| 1674 | if stub.func.is_property: |
| 1675 | for message in _verify_readonly_property(stub, runtime): |
| 1676 | yield Error(object_path, message, stub, runtime) |
| 1677 | for message in _verify_abstract_status(stub.func, runtime): |
| 1678 | yield Error(object_path, message, stub, runtime) |
| 1679 | return |
| 1680 | |
| 1681 | func = _resolve_funcitem_from_decorator(stub) |
| 1682 | if func is not None: |
| 1683 | yield from verify(func, runtime, object_path) |
| 1684 | |
| 1685 | |
| 1686 | @verify.register(nodes.TypeAlias) |
nothing calls this directly
no test coverage detected
searching dependent graphs…