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