@contextlib.contextmanager
def MockArbitraryBuffer(filetype):
 current_buffer = VimBuffer(os.path.realpath(u'TEST_BUFFER'), window=1, filetype=filetype)
 with MockVimBuffers([current_buffer], current_buffer):
  (yield)

@ contextlib . contextmanager def MockArbitraryBuffer ( filetype ) : current_buffer = VimBuffer ( os . path . realpath ( u'TEST_BUFFER' ) , window = 1 , filetype = filetype ) with MockVimBuffers ( [ current_buffer ] , current_buffer ) : ( yield )
used via the with statement .