def METHOD_NAME(self, monkeypatch, cli, type_):
    autodetect = pretend.call_recorder(lambda: "plain")
    monkeypatch.setattr(shell, "autodetect", autodetect)
    session = pretend.stub()
    session_cls = pretend.call_recorder(lambda bind: session)
    monkeypatch.setattr(db, "Session", session_cls)
    runner = pretend.call_recorder(lambda **kw: None)
    monkeypatch.setattr(shell, type_, runner)
    engine = pretend.stub()
    config = pretend.stub(registry={"sqlalchemy.engine": engine})
    result = cli.invoke(shell.shell, ["--type", type_], obj=config)
    assert result.exit_code == 0
    assert autodetect.calls == []
    assert session_cls.calls == [pretend.call(bind=engine)]
    assert runner.calls == [pretend.call(config=config, db=session)]