Пример #1
0
def session(tmpdir):
    db_file = os.path.join(tmpdir.strpath, 'temp.db')
    if os.path.exists(db_file):
        os.remove(db_file)

    create_all_tables(db_file)
    session = connect(db_file)
    yield session
    session.close()
Пример #2
0
def session(tmpdir):
    db_file = os.path.join(tmpdir.strpath, 'temp.db')
    if os.path.exists(db_file):
        os.remove(db_file)

    create_all_tables(db_file)
    session = connect(db_file)
    yield session
    session.close()
Пример #3
0
def session_with_artist_including_unicode(tmpdir):
    db_file = os.path.join(tmpdir.strpath, 'temp.db')
    if os.path.exists(db_file):
        os.remove(db_file)

    create_all_tables(db_file)
    session = connect(db_file)
    with vcr.use_cassette('test_add_artist_to_db_unicode'):
        add_artist_to_db(ALT_J_MBID, session)  # Tested separately
    session.commit()
    yield session
    session.close()
Пример #4
0
def session_with_artist_including_unicode(tmpdir):
    db_file = os.path.join(tmpdir.strpath, 'temp.db')
    if os.path.exists(db_file):
        os.remove(db_file)

    create_all_tables(db_file)
    session = connect(db_file)
    with vcr.use_cassette('test_add_artist_to_db_unicode'):
        add_artist_to_db(ALT_J_MBID, session)  # Tested separately
    session.commit()
    yield session
    session.close()