def _check_using_constant_test(self, node, test):
    const_nodes = (astroid.Module, astroid.scoped_nodes.GeneratorExp, astroid.Lambda, astroid.FunctionDef, astroid.ClassDef, astroid.bases.Generator, astroid.UnboundMethod, astroid.BoundMethod, astroid.Module)
    structs = (astroid.Dict, astroid.Tuple, astroid.Set)
    except_nodes = (astroid.Call, astroid.BinOp, astroid.BoolOp, astroid.UnaryOp, astroid.Subscript)
    inferred = None
    emit = isinstance(test, (((astroid.Const,) + structs) + const_nodes))
    if (not isinstance(test, except_nodes)):
        inferred = utils.safe_infer(test)
    if emit:
        self.add_message('using-constant-test', node=node)
    elif isinstance(inferred, const_nodes):
        call_inferred = None
        try:
            if isinstance(inferred, astroid.FunctionDef):
                call_inferred = inferred.infer_call_result()
            elif isinstance(inferred, astroid.Lambda):
                call_inferred = inferred.infer_call_result(node)
        except astroid.InferenceError:
            call_inferred = None
        if call_inferred:
            try:
                for inf_call in call_inferred:
                    if (inf_call != astroid.Uninferable):
                        self.add_message('missing-parentheses-for-call-in-test', node=node)
                        break
            except astroid.InferenceError:
                pass
        self.add_message('using-constant-test', node=node)
def _check_using_constant_test(self, node, test):
    const_nodes = (astroid.Module, astroid.scoped_nodes.GeneratorExp, astroid.Lambda, astroid.FunctionDef, astroid.ClassDef, astroid.bases.Generator, astroid.UnboundMethod, astroid.BoundMethod, astroid.Module)
    structs = (astroid.Dict, astroid.Tuple, astroid.Set)
    except_nodes = (astroid.Call, astroid.BinOp, astroid.BoolOp, astroid.UnaryOp, astroid.Subscript)
    inferred = None
    emit = isinstance(test, (((astroid.Const,) + structs) + const_nodes))
    if (not isinstance(test, except_nodes)):
        inferred = utils.safe_infer(test)
    if emit:
        self.add_message('using-constant-test', node=node)
    elif isinstance(inferred, const_nodes):
        call_inferred = None
        try:
            if isinstance(inferred, astroid.FunctionDef):
                call_inferred = inferred.infer_call_result()
            elif isinstance(inferred, astroid.Lambda):
                call_inferred = inferred.infer_call_result(node)
        except astroid.InferenceError:
            call_inferred = None
        if call_inferred:
            try:
                for inf_call in call_inferred:
                    if (inf_call != astroid.Uninferable):
                        self.add_message('missing-parentheses-for-call-in-test', node=node)
                        break
            except astroid.InferenceError:
                pass
        self.add_message('using-constant-test', node=node)