<commit_before>import unittest

import glob
import os

import mmstats


class MmstatsTestCase(unittest.TestCase):
    def setUp(self):
        super(MmstatsTestCase, self).setUp()
        self.path = mmstats.DEFAULT_PATH

        # Clean out stale mmstats files
        for fn in glob.glob(os.path.join(self.path, 'test*.mmstats')):
            try:
                os.remove(fn)
                pass
            except OSError:
                print 'Could not remove: %s' % fn

    def tearDown(self):
        # clean the dir after tests
        for fn in glob.glob(os.path.join(self.path, 'test*.mmstats')):
            try:
                os.remove(fn)
                pass
            except OSError:
                continue
<commit_msg>Refactor test harness file discovery<commit_after>import unittest

import glob
import os

import mmstats


class MmstatsTestCase(unittest.TestCase):
    @property
    def files(self):
        return glob.glob(os.path.join(self.path, 'test*.mmstats'))

    def setUp(self):
        super(MmstatsTestCase, self).setUp()
        self.path = mmstats.DEFAULT_PATH

        # Clean out stale mmstats files
        for fn in self.files:
            try:
                os.remove(fn)
                pass
            except OSError:
                print 'Could not remove: %s' % fn

    def tearDown(self):
        # clean the dir after tests
        for fn in self.files:
            try:
                os.remove(fn)
                pass
            except OSError:
                continue

{'fraction_non_alphanumeric': 0.08289817232375979, 'fraction_numerical': 0.0, 'mean_word_length': 1.6205128205128205, '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': '1299892', 'n_tokens_mistral': 448, 'n_tokens_neox': 419, 'n_words': 118}