<commit_before>import os
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from pyramid.paster import get_appsettings
from pyramid import testing
import unittest
from webtest import TestApp

from app_api import main
from app_api.models import *  # noqa


curdir = os.path.dirname(os.path.abspath(__file__))
configfile = os.path.realpath(os.path.join(curdir, '../../test.ini'))
settings = get_appsettings(configfile)


def get_engine():
    return engine_from_config(settings, 'sqlalchemy.')


def setup_package():
    # set up database
    engine = get_engine()
    DBSession.configure(bind=engine)
    Base.metadata.create_all(engine)

# keep the database schema after a test run (useful for debugging)
keep = False


def teardown_package():
    # tear down database
    engine = get_engine()
    if not keep:
        Base.metadata.drop_all(engine)


class BaseTestCase(unittest.TestCase):<commit_msg>No need to bind DBSession to engine in setup_package<commit_after>import os
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from pyramid.paster import get_appsettings
from pyramid import testing
import unittest
from webtest import TestApp

from app_api import main
from app_api.models import *  # noqa


curdir = os.path.dirname(os.path.abspath(__file__))
configfile = os.path.realpath(os.path.join(curdir, '../../test.ini'))
settings = get_appsettings(configfile)


def get_engine():
    return engine_from_config(settings, 'sqlalchemy.')


def setup_package():
    # set up database
    engine = get_engine()
    Base.metadata.create_all(engine)

# keep the database schema after a test run (useful for debugging)
keep = False


def teardown_package():
    # tear down database
    engine = get_engine()
    if not keep:
        Base.metadata.drop_all(engine)


class BaseTestCase(unittest.TestCase):
{'fraction_non_alphanumeric': 0.08663101604278074, 'fraction_numerical': 0.0, 'mean_word_length': 4.551928783382789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3482719', 'n_tokens_mistral': 583, 'n_tokens_neox': 560, 'n_words': 164}