Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
spacy / tests / test_errors.py
Size: Mime:
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__)