mirror of https://github.com/explosion/spaCy.git
* Avoid testing for object identity
This commit is contained in:
parent
e567713429
commit
b5b31c6b6e
|
@ -5,14 +5,14 @@ from spacy.en import EN
|
|||
|
||||
def test_single_word():
|
||||
lex_ids = EN.tokenize(u'hello')
|
||||
assert lex_ids[0] == EN.lexicon.lookup(u'hello')
|
||||
assert lex_ids[0].string == EN.lexicon.lookup(u'hello').string
|
||||
|
||||
|
||||
def test_two_words():
|
||||
words = EN.tokenize('hello possums')
|
||||
assert len(words) == 2
|
||||
assert words[0] == EN.lexicon.lookup('hello')
|
||||
assert words[0] != words[1]
|
||||
assert words[0].string == EN.lexicon.lookup('hello').string
|
||||
assert words[0].string != words[1].string
|
||||
|
||||
|
||||
def test_punct():
|
||||
|
|
|
@ -5,12 +5,12 @@ from spacy.en import EN
|
|||
|
||||
def test_neq():
|
||||
addr = EN.lookup('Hello')
|
||||
assert EN.lookup('bye') != addr
|
||||
assert EN.lookup('bye').string != addr.string
|
||||
|
||||
|
||||
def test_eq():
|
||||
addr = EN.lookup('Hello')
|
||||
assert EN.lookup('Hello') == addr
|
||||
assert EN.lookup('Hello').string == addr.string
|
||||
|
||||
|
||||
def test_round_trip():
|
||||
|
@ -20,12 +20,12 @@ def test_round_trip():
|
|||
|
||||
def test_case_neq():
|
||||
addr = EN.lookup('Hello')
|
||||
assert EN.lookup('hello') != addr
|
||||
assert EN.lookup('hello').string != addr.string
|
||||
|
||||
|
||||
def test_punct_neq():
|
||||
addr = EN.lookup('Hello')
|
||||
assert EN.lookup('Hello,') != addr
|
||||
assert EN.lookup('Hello,').string != addr.string
|
||||
|
||||
|
||||
def test_short():
|
||||
|
|
Loading…
Reference in New Issue