mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			333 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			333 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from inspect import isclass
 | 
						|
 | 
						|
import pytest
 | 
						|
 | 
						|
from spacy.errors import ErrorsWithCodes
 | 
						|
 | 
						|
 | 
						|
class Errors(metaclass=ErrorsWithCodes):
 | 
						|
    E001 = "error description"
 | 
						|
 | 
						|
 | 
						|
def test_add_codes():
 | 
						|
    assert Errors.E001 == "[E001] error description"
 | 
						|
    with pytest.raises(AttributeError):
 | 
						|
        Errors.E002
 | 
						|
    assert isclass(Errors.__class__)
 |