From 94b6be4e8381edbd98132cd9956676f6ac71a8a5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 May 2021 10:54:34 +0200 Subject: [PATCH] preferred way to say that something needs to be implemented --- python/damask/_config.py | 4 ++-- python/tests/test_Config.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/damask/_config.py b/python/damask/_config.py index 627fc88c8..9e1686a30 100644 --- a/python/damask/_config.py +++ b/python/damask/_config.py @@ -162,11 +162,11 @@ class Config(dict): @abc.abstractmethod def is_complete(self): """Check for completeness.""" - pass + raise NotImplementedError @property @abc.abstractmethod def is_valid(self): """Check for valid file layout.""" - pass + raise NotImplementedError diff --git a/python/tests/test_Config.py b/python/tests/test_Config.py index d2f0b5e72..ae93b231d 100644 --- a/python/tests/test_Config.py +++ b/python/tests/test_Config.py @@ -49,10 +49,12 @@ class TestConfig: assert Config({'A':np.ones(3,'i')}).__repr__() == Config({'A':[1,1,1]}).__repr__() def test_abstract_is_valid(self): - assert Config().is_valid is None + with pytest.raises(NotImplementedError): + Config().is_valid def test_abstract_is_complete(self): - assert Config().is_complete is None + with pytest.raises(NotImplementedError): + Config().is_complete @pytest.mark.parametrize('data',[Rotation.from_random(),Orientation.from_random(lattice='cI')]) def test_rotation_orientation(self,data):