require
forge.strategyfunctionSince Forge API 1
Signaturepython
forge.strategy.require(condition: object, message: str) -> NoneStop the run with message unless condition is true.
Parameters
| Name | Type |
|---|---|
| condition | object |
| message | str |
A plain assert works the same way. Both stop the run, in compute() or in a hook, with
the
file and line of the check. condition is one true or false value: for an array write
require(bool(x.all()), ...).