<commit_before>import unittest
import os

def get_suite():
    names = os.listdir(os.path.dirname(__file__))
    names = ["deliver.tests.%s" % m[:-3]
             for m in names
             if m.startswith("test_") and m.endswith(".py")]
    suite = unittest.TestLoader().loadTestsFromNames(names)
    return suite

test_suite = get_suite()

def main():
    unittest.TextTestRunner().run(test_suite)

if __name__ == "__main__":
    main()
<commit_msg>modify test runner to accept nested packages<commit_after>import unittest
import os

def get_suite():
    all_names = []
    for path, _, names in os.walk(os.path.dirname(__file__)):
        names = ["%s.%s" % (get_package(path), m[:-3])
                 for m in names
                 if m.startswith("test_") and m.endswith(".py")]
        all_names += names
    suite = unittest.TestLoader().loadTestsFromNames(all_names)
    return suite

def get_package(path):
    elements = []
    path, package = os.path.split(path)
    while package != 'deliver':
        elements.append(package)
        path, package = os.path.split(path)
    elements.append('deliver')
    return '.'.join(reversed(elements))

test_suite = get_suite()

def main():
    unittest.TextTestRunner().run(test_suite)

if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.13973458235753317, 'fraction_numerical': 0.00156128024980484, 'mean_word_length': 3.0569620253164556, 'pattern_counts': {'":': 2, '<': 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': '4121909', 'n_tokens_mistral': 418, 'n_tokens_neox': 414, 'n_words': 93}