mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	Extension serialization attr tests: add teardown (#13284)
The doc/token extension serialization tests add extensions that are not serializable with pickle. This didn't cause issues before due to the implicit run order of tests. However, test ordering has changed with pytest 8.0.0, leading to failed tests in test_language. Update the fixtures in the extension serialization tests to do proper teardown and remove the extensions.
This commit is contained in:
		
							parent
							
								
									00e938a7c3
								
							
						
					
					
						commit
						68d7841df5
					
				|  | @ -15,7 +15,12 @@ def doc_w_attrs(en_tokenizer): | ||||||
|     Token.set_extension("_test_token", default="t0") |     Token.set_extension("_test_token", default="t0") | ||||||
|     doc[1]._._test_token = "t1" |     doc[1]._._test_token = "t1" | ||||||
| 
 | 
 | ||||||
|     return doc |     yield doc | ||||||
|  | 
 | ||||||
|  |     Doc.remove_extension("_test_attr") | ||||||
|  |     Doc.remove_extension("_test_prop") | ||||||
|  |     Doc.remove_extension("_test_method") | ||||||
|  |     Token.remove_extension("_test_token") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_serialize_ext_attrs_from_bytes(doc_w_attrs): | def test_serialize_ext_attrs_from_bytes(doc_w_attrs): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user