test_regex.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:hypothesis-regex 作者: maximkulkin 项目源码 文件源码
def assert_all_examples(strategy, predicate):
    '''
    Checks that there are no examples with given strategy
    that do not match predicate.

    :param strategy: Hypothesis strategy to check
    :param predicate: (callable) Predicate that takes string example and returns bool
    '''
    @h.settings(max_examples=1000, max_iterations=5000)
    @h.given(strategy)
    def assert_examples(s):
        assert predicate(s),'Found %r using strategy %s which does not match' % (
            s, strategy,
        )

    assert_examples()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号