diff --git a/localizationkit/tests/comment_similarity.py b/localizationkit/tests/comment_similarity.py index 2012a6c..26b407d 100644 --- a/localizationkit/tests/comment_similarity.py +++ b/localizationkit/tests/comment_similarity.py @@ -24,6 +24,9 @@ class CheckCommentSimilarity(LocalizationTestCase): violations = [] for string in self.collection.strings_for_language(self.configuration.default_language()): + if string.value is None or string.comment is None: + continue + similarity = difflib.SequenceMatcher(None, string.value, string.comment).ratio() if similarity > maximum_comment_similarity_ratio: diff --git a/localizationkit/tests/test_case.py b/localizationkit/tests/test_case.py index e56ae03..07d319a 100644 --- a/localizationkit/tests/test_case.py +++ b/localizationkit/tests/test_case.py @@ -68,7 +68,7 @@ class LocalizationTestCase(abc.ABC): try: violations = self.run_test() - if not violations: + if violations is None: raise Exception(f"Failed to get exceptions from test: {self.__class__.name()}") if len(violations):