コード例 #1
0
ファイル: unittest_nodes.py プロジェクト: DINKIN/XDM
 def test_absolute_import(self):
     astng = abuilder.file_build(self.datapath('absimport.py'))
     ctx = InferenceContext()
     ctx.lookupname = 'message'
     # will fail if absolute import failed
     astng['message'].infer(ctx).next()
     ctx.lookupname = 'email'
     m = astng['email'].infer(ctx).next()
     self.assertFalse(m.file.startswith(self.datapath('email.py')))
コード例 #2
0
 def test_absolute_import(self):
     astng = abuilder.file_build(self.datapath('absimport.py'))
     ctx = InferenceContext()
     ctx.lookupname = 'message'
     # will fail if absolute import failed
     astng['message'].infer(ctx).next()
     ctx.lookupname = 'email'
     m = astng['email'].infer(ctx).next()
     self.assertFalse(m.file.startswith(self.datapath('email.py')))
コード例 #3
0
ファイル: inference.py プロジェクト: daviewales/pylint-mode
def infer_name_module(self, name):
    context = InferenceContext()
    context.lookupname = name
    return self.infer(context, asname=False)
コード例 #4
0
def infer_name_module(self, name):
    context = InferenceContext()
    context.lookupname = name
    return self.infer(context, asname=False)