diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 37e53d00a25..2db103ffd68 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -1579,7 +1579,7 @@ def _check_invalid_class_object(self, node: nodes.AssignAttr) -> None: ): # If is uninferable, we allow it to prevent false positives return - self.add_message("invalid-class-object", node=node) + self.add_message("invalid-class-object", node=node, confidence=INFERENCE) def _check_in_slots(self, node: nodes.AssignAttr) -> None: """Check that the given AssignAttr node diff --git a/tests/functional/i/invalid/invalid_class_object.txt b/tests/functional/i/invalid/invalid_class_object.txt index 793a5de6916..3638965647c 100644 --- a/tests/functional/i/invalid/invalid_class_object.txt +++ b/tests/functional/i/invalid/invalid_class_object.txt @@ -1,5 +1,5 @@ -invalid-class-object:20:0:20:11::Invalid __class__ object:UNDEFINED -invalid-class-object:21:0:21:11::Invalid __class__ object:UNDEFINED -invalid-class-object:50:8:50:22:Pylint7429Good.class_defining_function_bad:Invalid __class__ object:UNDEFINED -invalid-class-object:58:15:58:29:Pylint7429Good.class_defining_function_bad_inverted:Invalid __class__ object:UNDEFINED -invalid-class-object:62:15:62:29:Pylint7429Good.class_defining_function_complex_bad:Invalid __class__ object:UNDEFINED +invalid-class-object:20:0:20:11::Invalid __class__ object:INFERENCE +invalid-class-object:21:0:21:11::Invalid __class__ object:INFERENCE +invalid-class-object:50:8:50:22:Pylint7429Good.class_defining_function_bad:Invalid __class__ object:INFERENCE +invalid-class-object:58:15:58:29:Pylint7429Good.class_defining_function_bad_inverted:Invalid __class__ object:INFERENCE +invalid-class-object:62:15:62:29:Pylint7429Good.class_defining_function_complex_bad:Invalid __class__ object:INFERENCE