<commit_before>#!/usr/bin/env python

import sys

from django.conf import settings

if not settings.configured:
    settings.configure(
        DATABASES={
            'default': {
                'ENGINE': 'django.db.backends.sqlite3',
                'NAME': ':memory:',
            }
        },
        INSTALLED_APPS=(
            'django_nose',
            'django.contrib.contenttypes',
            'popolo',
            'candidator',
        ),
        SITE_ID=1,
        TEST_RUNNER = 'django_nose.NoseTestSuiteRunner',
        SECRET_KEY='this-is-just-for-tests-so-not-that-secret',
        ROOT_URLCONF='popolo.urls',
    )

from django.test.utils import get_runner
def runtests():
    TestRunner = get_runner(settings)
    test_runner = TestRunner(verbosity=1, interactive=True, failfast=False)
    failures = test_runner.run_tests(['candidator', ])
    sys.exit(failures)
    if __name__ == '__main__':
        runtests()<commit_msg>Fixing test runner<commit_after>#!/usr/bin/env python

import sys

from django.conf import settings

if not settings.configured:
    settings.configure(
        DATABASES={
            'default': {
                'ENGINE': 'django.db.backends.sqlite3',
                'NAME': ':memory:',
            }
        },
        INSTALLED_APPS=(
            'django_nose',
            'django.contrib.contenttypes',
            'popolo',
            'candidator',
        ),
        SITE_ID=1,
        TEST_RUNNER = 'django_nose.NoseTestSuiteRunner',
        SECRET_KEY='this-is-just-for-tests-so-not-that-secret',
        ROOT_URLCONF='popolo.urls',
    )

from django.test.utils import get_runner


def runtests():
    test_runner_klass = get_runner(settings)
    test_runner = test_runner_klass(verbosity=1, interactive=True, failfast=False)
    failures = test_runner.run_tests(['candidator', ])
    sys.exit(failures)

if __name__ == '__main__':
    runtests()
{'fraction_non_alphanumeric': 0.12289915966386554, 'fraction_numerical': 0.0031512605042016808, 'mean_word_length': 2.295847750865052, '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': '4755145', 'n_tokens_mistral': 620, 'n_tokens_neox': 606, 'n_words': 95}