<commit_before>#!/usr/bin/python

import os
import optparse
import sys
import unittest

USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.

SDK_PATH     Path to the SDK installation.
TEST_PATH    Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""


def main(sdk_path, test_path, webtest_path):
    sys.path.insert(0, sdk_path)
    import dev_appserver
    dev_appserver.fix_sys_path()
    sys.path.append(webtest_path)
    suite = unittest.loader.TestLoader().discover(test_path,
                                                  pattern="*test.py")
    return unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful()


if __name__ == '__main__':
    parser = optparse.OptionParser(USAGE)
    options, args = parser.parse_args()
    if len(args) != 3:
        print 'Error: Exactly 3 arguments required.'
        parser.print_help()
        sys.exit(1)
    SDK_PATH = args[0]
    TEST_PATH = args[1]
    WEBTEST_PATH = args[2]
    sys.exit(not main(SDK_PATH, TEST_PATH, WEBTEST_PATH))<commit_msg>Revert "Python tests now return an error code on fail."<commit_after>#!/usr/bin/python

import os
import optparse
import sys
import unittest

USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.

SDK_PATH     Path to the SDK installation.
TEST_PATH    Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""


def main(sdk_path, test_path, webtest_path):
    sys.path.insert(0, sdk_path)
    import dev_appserver
    dev_appserver.fix_sys_path()
    sys.path.append(webtest_path)
    suite = unittest.loader.TestLoader().discover(test_path,
                                                  pattern="*test.py")
    unittest.TextTestRunner(verbosity=2).run(suite)


if __name__ == '__main__':
    parser = optparse.OptionParser(USAGE)
    options, args = parser.parse_args()
    if len(args) != 3:
        print 'Error: Exactly 3 arguments required.'
        parser.print_help()
        sys.exit(1)
    SDK_PATH = args[0]
    TEST_PATH = args[1]
    WEBTEST_PATH = args[2]
    main(SDK_PATH, TEST_PATH, WEBTEST_PATH)
{'fraction_non_alphanumeric': 0.09844559585492228, 'fraction_numerical': 0.007536504945831371, 'mean_word_length': 3.092485549132948, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191229', 'n_tokens_mistral': 699, 'n_tokens_neox': 675, 'n_words': 172}