You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
333 B

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__)