<commit_before>#-*- coding: utf-8 -*-
import unittest


class FontTestCase(unittest.TestCase):

    def setUp(self):
        import os
        self.font_name = os.path.join(os.path.dirname(__file__), u'कीवी.ttf')
        if not os.path.exists(self.font_name):
            from zipfile import ZipFile
            with ZipFile(os.path.join(os.path.dirname(__file__),
                                      'unicode_font.zip'), 'r') as myzip:
                myzip.extractall(path=os.path.dirname(__file__))
        print(self.font_name)

    def test_unicode_name(self):
        from kivy.core.text import Label
        lbl = Label(font_name=self.font_name)
        lbl.refresh()
        self.assertNotEqual(lbl.get_extents(''), None)

    def tearDown(self):
        import os
        if os.path.exists(self.font_name):
            os.unlink(self.font_name)
<commit_msg>Don't cause exception if font file is still in use by system.<commit_after>#-*- coding: utf-8 -*-
import unittest


class FontTestCase(unittest.TestCase):

    def setUp(self):
        import os
        self.font_name = os.path.join(os.path.dirname(__file__), u'कीवी.ttf')
        if not os.path.exists(self.font_name):
            from zipfile import ZipFile
            with ZipFile(os.path.join(os.path.dirname(__file__),
                                      'unicode_font.zip'), 'r') as myzip:
                myzip.extractall(path=os.path.dirname(__file__))
        print(self.font_name)

    def test_unicode_name(self):
        from kivy.core.text import Label
        lbl = Label(font_name=self.font_name)
        lbl.refresh()
        self.assertNotEqual(lbl.get_extents(''), None)

    def tearDown(self):
        import os
        if os.path.exists(self.font_name):
            try:
                os.unlink(self.font_name)
            except:
                pass

{'fraction_non_alphanumeric': 0.11592632719393282, 'fraction_numerical': 0.0010834236186348862, 'mean_word_length': 2.05794701986755, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '738195', 'n_tokens_mistral': 595, 'n_tokens_neox': 573, 'n_words': 108}