<commit_before>import os
import unittest
from sqlalchemy import engine_from_config
from pyramid import testing
from sqlalchemy.orm import sessionmaker
from apex.models import DBSession
here = os.path.abspath(os.path.dirname(__file__))


""" bare minimum settings required for testing
"""
settings = {
    'sqlalchemy.url':'sqlite:///apex.test.db',
    'mako.directories':'{0}/../apex/templates'.format(here),
    'apex.session_secret':'session_secret',
    'apex.auth_secret':'auth_secret',
    'apex.came_from_route':'home',
    'apex.velruse_config':'{0}/CONFIG.yaml'.format(here),
    'apex.use_recaptcha_on_login': 'false',
}


class BaseTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        """ must add default route 'home' and include apex
            we also must create a default user/pass/group to test
        """
        cls.engine = engine_from_config(settings, prefix='sqlalchemy.')
        cls.Session = sessionmaker()

    def setUp(self):<commit_msg>create and teardown the tables on setup and teardown<commit_after>import os
import unittest
from sqlalchemy import engine_from_config
from pyramid import testing
from sqlalchemy.orm import sessionmaker
from apex.models import DBSession
from apex.models import Base
here = os.path.abspath(os.path.dirname(__file__))


""" bare minimum settings required for testing
"""
settings = {
    'sqlalchemy.url':'sqlite:///apex.test.db',
    'mako.directories':'{0}/../apex/templates'.format(here),
    'apex.session_secret':'session_secret',
    'apex.auth_secret':'auth_secret',
    'apex.came_from_route':'home',
    'apex.velruse_config':'{0}/CONFIG.yaml'.format(here),
    'apex.use_recaptcha_on_login': 'false',
}


class BaseTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        """ must add default route 'home' and include apex
            we also must create a default user/pass/group to test
        """
        cls.engine = engine_from_config(settings, prefix='sqlalchemy.')
        DBSession.configure(bind=cls.engine)
        Base.metadata.create_all(cls.engine)

        cls.Session = sessionmaker()

    @classmethod
    def tearDownClass(cls):
        DBSession.close()
        from apex.models import Base
        Base.metadata.drop_all(cls.engine)


    def setUp(self):
{'fraction_non_alphanumeric': 0.12282229965156795, 'fraction_numerical': 0.0017421602787456446, 'mean_word_length': 3.785416666666667, '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': '5682770', 'n_tokens_mistral': 747, 'n_tokens_neox': 701, 'n_words': 154}