Ejemplo n.º 1
0
def session(request, tmpdir):
    db_path = tmpdir.join("nsot.sqlite")
    db_engine = models.get_db_engine("sqlite:///%s" % db_path)

    Model.metadata.drop_all(db_engine)
    Model.metadata.create_all(db_engine)
    Session.configure(bind=db_engine)
    session = Session()

    def fin():
        session.close()
    request.addfinalizer(fin)

    return session
Ejemplo n.º 2
0
def session(request, tmpdir):
    db_path = tmpdir.join("nsot.sqlite")
    db_engine = models.get_db_engine("sqlite:///%s" % db_path)

    Model.metadata.drop_all(db_engine)
    Model.metadata.create_all(db_engine)
    Session.configure(bind=db_engine)
    session = Session()

    def fin():
        session.close()
    request.addfinalizer(fin)

    return session
Ejemplo n.º 3
0
def tornado_app(request, tmpdir):
    db_path = tmpdir.join("nsot.sqlite")
    db_engine = models.get_db_engine("sqlite:///%s" % db_path)

    Model.metadata.drop_all(db_engine)
    Model.metadata.create_all(db_engine)
    Session.configure(bind=db_engine)

    Fate._all_fates = None

    my_settings = {
        "db_engine": db_engine,
        "db_session": Session,
        "domain": "example.com"
    }

    tornado_settings = {
        "debug": False,
    }

    return Application(my_settings=my_settings, **tornado_settings)
Ejemplo n.º 4
0
def tornado_app(request, tmpdir):
    db_path = tmpdir.join("nsot.sqlite")
    db_engine = models.get_db_engine("sqlite:///%s" % db_path)

    Model.metadata.drop_all(db_engine)
    Model.metadata.create_all(db_engine)
    Session.configure(bind=db_engine)

    Fate._all_fates = None

    my_settings = {
        "db_engine": db_engine,
        "db_session": Session,
        "domain": "example.com"
    }

    tornado_settings = {
        "debug": False,
    }

    return Application(my_settings=my_settings, **tornado_settings)