<commit_before>"""
desispec.test.desispec_test_suite
=================================

Used to initialize the unit test framework via ``python setup.py test``.
"""
#
from __future__ import absolute_import, division, print_function, unicode_literals
#
import unittest
from os.path import dirname
#
#- This is factored out separately from runtests() so that it can be used by
#- python setup.py test
def desispec_test_suite():
    """Returns unittest.TestSuite of desispec tests"""
    desispec_dir = dirname(dirname(__file__))
    return unittest.defaultTestLoader.discover(desispec_dir)

def runtests():
    """
    Run all tests in desispec.test.test_*
    """
    #- Load all TestCase classes from desispec/test/test_*.py
    tests = desispec_test_suite()
    
    #- Run them
    unittest.TextTestRunner(verbosity=2).run(tests)

def orig_runtests():
    """
    Run all tests in desispec.test.test_*
    """
    import os.path
    #- Load all TestCase classes from desispec/test/test_*.py
    tests = unittest.TestLoader().discover(os.path.dirname(__file__))
        
    #- Run them
    unittest.TextTestRunner(verbosity=2).run(tests)<commit_msg>get the runtests() function working<commit_after>"""
desispec.test.desispec_test_suite
=================================

Used to initialize the unit test framework via ``python setup.py test``.
"""
#
from __future__ import absolute_import, division, print_function, unicode_literals
#
import unittest
#
#- This is factored out separately from runtests() so that it can be used by
#- python setup.py test
def desispec_test_suite():
    """Returns unittest.TestSuite of desispec tests"""
    from os.path import dirname
    desispec_dir = dirname(dirname(__file__))
    # print(desispec_dir)
    return unittest.defaultTestLoader.discover(desispec_dir,
        top_level_dir=dirname(desispec_dir))

def runtests():
    """Run all tests in desispec.test.test_*.
    """
    #- Load all TestCase classes from desispec/test/test_*.py
    tests = desispec_test_suite()
    #- Run them
    unittest.TextTestRunner(verbosity=2).run(tests)
{'fraction_non_alphanumeric': 0.13208453410182516, 'fraction_numerical': 0.001440922190201729, 'mean_word_length': 4.233668341708543, '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': '4809760', 'n_tokens_mistral': 650, 'n_tokens_neox': 643, 'n_words': 169}