<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import pytest
import shield
from shield.predicate import Predicate as P
from shield.contrib.sqlalchemy import evaluate
from . import sqlalchemy as models


class BaseTest:

    @pytest.fixture(autouse=True, scope='function')
    def database(self, request):
        meta = models.Base.metadata
        meta.create_all(models.engine)
        request.addfinalizer(lambda: meta.drop_all(models.engine))

    def setup(self):
        self.session = models.Session()


class TestSimplePredicate(BaseTest):

    def setup(self):
        super(TestSimplePredicate, self).setup()
<commit_msg>Have BaseTest inherit from object so that super() invocations work on python2.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import pytest
import shield
from shield.predicate import Predicate as P
from shield.contrib.sqlalchemy import evaluate
from . import sqlalchemy as models


class BaseTest(object):

    @pytest.fixture(autouse=True, scope='function')
    def database(self, request):
        meta = models.Base.metadata
        meta.create_all(models.engine)
        request.addfinalizer(lambda: meta.drop_all(models.engine))

    def setup(self):
        self.session = models.Session()


class TestSimplePredicate(BaseTest):

    def setup(self):
        super(TestSimplePredicate, self).setup()

{'fraction_non_alphanumeric': 0.0956641431520991, 'fraction_numerical': 0.0020646937370956643, 'mean_word_length': 4.031141868512111, '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': '7039809', 'n_tokens_mistral': 421, 'n_tokens_neox': 407, 'n_words': 111}