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

# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
# https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/runtests/runtests.py
import os
import sys

# fix sys path so we don't need to setup PYTHONPATH
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
os.environ['DJANGO_SETTINGS_MODULE'] = 'actstream.runtests.settings'

engine = 'django.db.backends.sqlite3'

try:
    engine = sys.argv[1:][0]
except IndexError:
    pass

if engine.startswith('mysql'):
    engine = 'django.db.backends.mysql'
elif engine.startswith('postgre'):
    engine = 'django.db.backends.postgresql_psycopg2'

os.environ['DATABASE_ENGINE'] = engine

try:
    from psycopg2cffi import compat
    compat.register()
except ImportError:
    pass

try:
    import pymysql
    pymysql.install_as_MySQLdb()
except ImportError:
    pass

import django
try:
    django.setup()
except AttributeError:
    pass


if __name__ == '__main__':
    from django.conf import settings
    from django.test.utils import get_runner

    sys.exit(get_runner(settings)().run_tests(['actstream', 'testapp']))
<commit_msg>dont run interactively<commit_after>#!/usr/bin/env python

# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
# https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/runtests/runtests.py
import os
import sys

# fix sys path so we don't need to setup PYTHONPATH
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
os.environ['DJANGO_SETTINGS_MODULE'] = 'actstream.runtests.settings'

engine = 'django.db.backends.sqlite3'

try:
    engine = sys.argv[1:][0]
except IndexError:
    pass

if engine.startswith('mysql'):
    engine = 'django.db.backends.mysql'
elif engine.startswith('postgre'):
    engine = 'django.db.backends.postgresql_psycopg2'

os.environ['DATABASE_ENGINE'] = engine

try:
    from psycopg2cffi import compat
    compat.register()
except ImportError:
    pass

try:
    import pymysql
    pymysql.install_as_MySQLdb()
except ImportError:
    pass

import django
try:
    django.setup()
except AttributeError:
    pass


if __name__ == '__main__':
    from django.conf import settings
    from django.test.utils import get_runner

    sys.exit(get_runner(settings)(interactive=False).run_tests(['actstream', 'testapp']))

{'fraction_non_alphanumeric': 0.1386029411764706, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 4.345776031434185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7033369', 'n_tokens_mistral': 1015, 'n_tokens_neox': 984, 'n_words': 158}