Update tests

This commit is contained in:
Ines Montani 2020-09-29 18:14:15 +02:00
parent 71a0ee274a
commit 7851020653
4 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ def test_initialize_examples():
# you shouldn't really call this more than once, but for testing it should be fine # you shouldn't really call this more than once, but for testing it should be fine
nlp.initialize() nlp.initialize()
nlp.initialize(get_examples=lambda: train_examples) nlp.initialize(get_examples=lambda: train_examples)
with pytest.raises(TypeError): with pytest.raises(ValueError):
nlp.initialize(get_examples=lambda: None) nlp.initialize(get_examples=lambda: None)
with pytest.raises(ValueError): with pytest.raises(ValueError):
nlp.initialize(get_examples=train_examples) nlp.initialize(get_examples=train_examples)

View File

@ -40,7 +40,7 @@ def test_initialize_examples():
# you shouldn't really call this more than once, but for testing it should be fine # you shouldn't really call this more than once, but for testing it should be fine
nlp.initialize() nlp.initialize()
nlp.initialize(get_examples=lambda: train_examples) nlp.initialize(get_examples=lambda: train_examples)
with pytest.raises(TypeError): with pytest.raises(ValueError):
nlp.initialize(get_examples=lambda: None) nlp.initialize(get_examples=lambda: None)
with pytest.raises(ValueError): with pytest.raises(ValueError):
nlp.initialize(get_examples=train_examples) nlp.initialize(get_examples=train_examples)

View File

@ -74,7 +74,7 @@ def test_initialize_examples():
# you shouldn't really call this more than once, but for testing it should be fine # you shouldn't really call this more than once, but for testing it should be fine
nlp.initialize() nlp.initialize()
nlp.initialize(get_examples=lambda: train_examples) nlp.initialize(get_examples=lambda: train_examples)
with pytest.raises(TypeError): with pytest.raises(ValueError):
nlp.initialize(get_examples=lambda: None) nlp.initialize(get_examples=lambda: None)
with pytest.raises(TypeError): with pytest.raises(TypeError):
nlp.initialize(get_examples=lambda: train_examples[0]) nlp.initialize(get_examples=lambda: train_examples[0])

View File

@ -121,7 +121,7 @@ def test_initialize_examples():
# you shouldn't really call this more than once, but for testing it should be fine # you shouldn't really call this more than once, but for testing it should be fine
nlp.initialize() nlp.initialize()
nlp.initialize(get_examples=lambda: train_examples) nlp.initialize(get_examples=lambda: train_examples)
with pytest.raises(TypeError): with pytest.raises(ValueError):
nlp.initialize(get_examples=lambda: None) nlp.initialize(get_examples=lambda: None)
with pytest.raises(ValueError): with pytest.raises(ValueError):
nlp.initialize(get_examples=train_examples) nlp.initialize(get_examples=train_examples)