Example #1
0
def test_length_constraint():
    # When repr is still too long, use bruteforce ellipsis
    # repr is a very long line so we don't check for equality here, just that
    # ellipsis has been done. It's not the ellipsis from before because the
    # number of elements in the dict is only 1.
    vocabulary = {0: 'hello' * 1000}
    vectorizer = CountVectorizer(vocabulary=vocabulary)
    repr_ = vectorizer.__repr__()
    assert '...' in repr_
Example #2
0
def test_length_constraint():
    # When repr is still too long, use bruteforce ellipsis
    # repr is a very long line so we don't check for equality here, just that
    # ellipsis has been done. It's not the ellipsis from before because the
    # number of elements in the dict is only 1.
    vocabulary = {0: 'hello' * 1000}
    vectorizer = CountVectorizer(vocabulary=vocabulary)
    repr_ = vectorizer.__repr__()
    assert '...' in repr_