| 33 | |
| 34 | |
| 35 | class NotImplementedWarning(RuntimeWarning): |
| 36 | # pytest.warns() requires that Warning() subclasses are constructed by passing a |
| 37 | # single argument (the warning message). Use a factory method to avoid reproducing |
| 38 | # the message format and the warn invocation. |
| 39 | @classmethod |
| 40 | def warn(cls, platform: str, feature: str) -> None: |
| 41 | """Raise a warning that a feature isn't implemented on a platform.""" |
| 42 | warnings.warn( |
| 43 | NotImplementedWarning(f"[{platform}] Not implemented: {feature}"), |
| 44 | stacklevel=2, |
| 45 | ) |
| 46 | |
| 47 | |
| 48 | __version__ = version("toga-core") |