<commit_before>import sys
import pep8

from coverage import coverage
from distutils import log
from django.conf import settings
from importlib import import_module
from StringIO import StringIO

def init(test_suite):
    try:
        test_settings = import_module('%s.settings' % test_suite)
    except ImportError:
        log.info('ImportError: Unable to import %s.settings' % test_suite)
        sys.exit(1)

    setting_attrs = {}
    for attr in dir(test_settings):
        if '__' not in attr:
            setting_attrs[attr] = getattr(test_settings, attr)
<commit_msg>more robust test settings import<commit_after>import sys
import pep8

from coverage import coverage
from distutils import log
from django.conf import settings
from StringIO import StringIO


def init(test_suite):
    try:
        test_settings = __import__('test_settings')
    except ImportError, e:
        log.info('ImportError: Unable to import test settings.')
        sys.exit(1)

    setting_attrs = {}
    for attr in dir(test_settings):
        if '__' not in attr:
            setting_attrs[attr] = getattr(test_settings, attr)

{'fraction_non_alphanumeric': 0.07547169811320754, 'fraction_numerical': 0.0035938903863432167, 'mean_word_length': 3.4382470119521913, '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': '5357039', 'n_tokens_mistral': 322, 'n_tokens_neox': 316, 'n_words': 102}