<commit_before>__all__ = [
    'test',
]

def test(close=False):
    """
    @desc: This is a convienance method to run all of the tests in `PVGeo`.

    @notes:
    This can be executed from either the command line of within a standard Python environment:

    ```bash
    $ python -m PVGeo test
    ```

    ```py
    >>> import PVGeo
    >>> PVGeo.test()
    ```
    """
    import unittest
    import fnmatch
    import os
    path = os.path.dirname(__file__) # path to remove
    path = path[0:path.rfind('/')]
    test_file_strings = []
    for root, dirnames, filenames in os.walk(os.path.dirname(__file__)):
        for filename in fnmatch.filter(filenames, '__test__.py'):
            test_file_strings.append(os.path.join(root, filename).replace(path, ''))
    # Remove extensions and change to module import syle
    module_strings = [str[1:len(str)-3].replace('/', '.') for str in test_file_strings]
    suites = [unittest.defaultTestLoader.loadTestsFromName(str) for str
              in module_strings]
    testSuite = unittest.TestSuite(suites)
    run = unittest.TextTestRunner(verbosity=2).run(testSuite)
    if close:
        exit(len(run.failures) > 0 or len(run.errors) > 0)
    return run<commit_msg>Fixed tester to be python 2 compatible<commit_after>__all__ = [
    'test',
]
import unittest
import fnmatch
import os

def test(close=False):
    """
    @desc: This is a convienance method to run all of the tests in `PVGeo`.

    @notes:
    This can be executed from either the command line of within a standard Python environment:

    ```bash
    $ python -m PVGeo test
    ```

    ```py
    >>> import PVGeo
    >>> PVGeo.test()
    ```
    """
    test_file_strings = []
    for root, dirnames, filenames in os.walk('.'):
        for filename in fnmatch.filter(filenames, '__test__.py'):
            test_file_strings.append(os.path.join(root, filename))
    # Remove extensions and change to module import syle
    module_strings = [mod[2:len(mod)-3].replace('/', '.') for mod in test_file_strings]
    suites = [unittest.defaultTestLoader.loadTestsFromName(mod) for mod
              in module_strings]
    testSuite = unittest.TestSuite(suites)
    run = unittest.TextTestRunner(verbosity=2).run(testSuite)
    if close:
        exit(len(run.failures) > 0 or len(run.errors) > 0)
    return run
{'fraction_non_alphanumeric': 0.11994840928632847, 'fraction_numerical': 0.005159071367153913, 'mean_word_length': 2.9845890410958904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '3665977', 'n_tokens_mistral': 754, 'n_tokens_neox': 733, 'n_words': 204}