@pytest.fixture
def xonsh_execer(monkeypatch):
 monkeypatch.setattr(xonsh.built_ins, 'load_builtins', (lambda *args, **kwargs: None))
 execer = Execer(login=False, unload=False)
 builtins.__xonsh_execer__ = execer
 return execer

@ pytest . fixture def xonsh_execer ( monkeypatch ) : monkeypatch . setattr ( xonsh . built_ins , 'load_builtins' , ( lambda * args , ** kwargs : None ) ) execer = Execer ( login = False , unload = False ) builtins . __xonsh_execer__ = execer return execer
initiate the execer with a mocked nop load_builtins .