我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用hypothesis.strategies.composite()。
def api_metadata( draw, maintainer_names=text(), versions=text() ) -> APIMetadataInterface: """ :param draw: A function supplied by the ``@composite`` decorator, which knows how to draw a randomly-generated sample from the strategies provided by ``hypothesis`` :param maintainer_names: A generator for maintainer names :param versions: A generator for API versions :return: A randomly-generated API Metadata model """ return _APIMetadata( draw(maintainer_names), draw(versions) )