<commit_before>from django.test.simple import DjangoTestSuiteRunner

from mongoengine import connect

class TestRunner(DjangoTestSuiteRunner):
    def setup_databases(self, **kwargs):
        db_name = 'newsblur_test'
        connect(db_name)
        print 'Creating test-database: ' + db_name

        return super(TestRunner, self).setup_databases(**kwargs)

    def teardown_databases(self, old_config, **kwargs):
        import pymongo
        conn = pymongo.MongoClient()
        db_name = 'newsblur_test'
        conn.drop_database(db_name)
        print ('Dropping test-database: %s' % db_name)
        return super(TestRunner, self).teardown_databases(old_config, **kwargs)

<commit_msg>use DiscoverRunner to run tests<commit_after>from django.test.runner import DiscoverRunner
from mongoengine import connect

class TestRunner(DiscoverRunner):
    def setup_databases(self, **kwargs):
        db_name = 'newsblur_test'
        connect(db_name)
        print 'Creating test-database: ' + db_name

        return super(TestRunner, self).setup_databases(**kwargs)

    def teardown_databases(self, old_config, **kwargs):
        import pymongo
        conn = pymongo.MongoClient()
        db_name = 'newsblur_test'
        conn.drop_database(db_name)
        print ('Dropping test-database: %s' % db_name)
        return super(TestRunner, self).teardown_databases(old_config, **kwargs)


{'fraction_non_alphanumeric': 0.09475951184493898, 'fraction_numerical': 0.0, 'mean_word_length': 3.585526315789474, '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': '3906688', 'n_tokens_mistral': 434, 'n_tokens_neox': 417, 'n_words': 90}