mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 07:57:35 +03:00 
			
		
		
		
	Add test for #3880
This commit is contained in:
		
							parent
							
								
									4e04080b76
								
							
						
					
					
						commit
						87f7ec34d5
					
				
							
								
								
									
										23
									
								
								spacy/tests/regression/test_issue3880.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								spacy/tests/regression/test_issue3880.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| # coding: utf8 | ||||
| from __future__ import unicode_literals | ||||
| from spacy.lang.en import English | ||||
| import pytest | ||||
| 
 | ||||
| 
 | ||||
| @pytest.mark.xfail | ||||
| def test_issue3880(): | ||||
|     """Test that `nlp.pipe()` works when an empty string ends the batch. | ||||
| 
 | ||||
|     Fixed in v7.0.5 of Thinc. | ||||
|     """ | ||||
|     texts = ["hello", "world", "", ""] | ||||
|     nlp = English() | ||||
|     nlp.add_pipe(nlp.create_pipe("parser")) | ||||
|     nlp.add_pipe(nlp.create_pipe("ner")) | ||||
|     nlp.add_pipe(nlp.create_pipe("tagger")) | ||||
|     nlp.get_pipe("parser").add_label("dep") | ||||
|     nlp.get_pipe("ner").add_label("PERSON") | ||||
|     nlp.get_pipe("tagger").add_label("NN") | ||||
|     nlp.begin_training() | ||||
|     for doc in nlp.pipe(texts): | ||||
|         pass | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user