diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9033659..0196821 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index f9c5949..310adff 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ target_dirs := tests coqpit test: ## run tests. - nosetests -x --with-cov -cov --cover-erase --cover-package coqpit tests --nologcapture --nocapture + coverage run -m pytest && coverage report --show-missing style: ## update code style. black ${target_dirs} diff --git a/coqpit/coqpit.py b/coqpit/coqpit.py index 07cd423..5cc590f 100644 --- a/coqpit/coqpit.py +++ b/coqpit/coqpit.py @@ -408,7 +408,7 @@ def deserialize(self, data: dict) -> "Serializable": init_kwargs[field.name] = value continue if value == MISSING: - raise ValueError("deserialized with unknown value for {} in {}".format(field.name, self.__name__)) + raise ValueError(f"deserialized with unknown value for {field.name} in {self.__name__}") value = _deserialize(value, field.type) init_kwargs[field.name] = value for k, v in init_kwargs.items(): @@ -438,7 +438,7 @@ def deserialize_immutable(cls, data: dict) -> "Serializable": init_kwargs[field.name] = value continue if value == MISSING: - raise ValueError("Deserialized with unknown value for {} in {}".format(field.name, cls.__name__)) + raise ValueError(f"Deserialized with unknown value for {field.name} in {cls.__name__}") value = _deserialize(value, field.type) init_kwargs[field.name] = value return cls(**init_kwargs) diff --git a/requirements_dev.txt b/requirements_dev.txt index 31e6b4f..3d5e87b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ pylint black -nose +pytest coverage