<commit_before>import unittest
import sys
import os

sys.path.insert(0, os.path.dirname(__file__))

if __name__ == "__main__":
    all_tests = unittest.TestLoader().discover('./tests')
    unittest.TextTestRunner().run(all_tests)
<commit_msg>Fix runtests.py to return non-zero exit code on test failure<commit_after>import unittest
import sys
import os

sys.path.insert(0, os.path.dirname(__file__))

if __name__ == "__main__":
    all_tests = unittest.TestLoader().discover('./tests')
    result = unittest.TextTestRunner().run(all_tests)
    sys.exit(not result.wasSuccessful())

{'fraction_non_alphanumeric': 0.13253012048192772, 'fraction_numerical': 0.0034423407917383822, 'mean_word_length': 5.191489361702128, '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': '1294029', 'n_tokens_mistral': 190, 'n_tokens_neox': 191, 'n_words': 40}