Esempio n. 1
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')))
Esempio n. 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')))
Esempio n. 3
0
def infer_name_module(self, name):
    context = InferenceContext()
    context.lookupname = name
    return self.infer(context, asname=False)
Esempio n. 4
0
def infer_name_module(self, name):
    context = InferenceContext()
    context.lookupname = name
    return self.infer(context, asname=False)