def MockVimModule():
 VIM_MOCK.buffers = {}
 VIM_MOCK.eval = MagicMock(side_effect=_MockVimEval)
 sys.modules[u'vim'] = VIM_MOCK
 return VIM_MOCK

def MockVimModule ( ) : VIM_MOCK . buffers = { } VIM_MOCK . eval = MagicMock ( side_effect = _MockVimEval ) sys . modules [ u'vim' ] = VIM_MOCK return VIM_MOCK
the vim module is something that is only present when running inside the vim python interpreter .