test_hypothesis.py 文件源码

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

项目:presswork 作者: hangtwenty 项目源码 文件源码
def test_hypothesis_text(s, each_text_maker):
    # have to get a fresh text maker EACH time function is invoked, due to Hypothesis quirk explained here:
    # http://hypothesis.works/articles/hypothesis-pytest-fixtures/
    text_maker = each_text_maker.clone()

    _input_tokenized = text_maker.input_text(s)

    sentences = text_maker.make_sentences(300)

    word_set_comparison = helpers.WordSetComparison(generated_tokens=sentences, input_tokenized=_input_tokenized)
    assert word_set_comparison.output_is_valid_strict()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号