<commit_before>import asyncio
from types import CoroutineType
from unittest import TestCase
from unittest.case import _Outcome


class AIOMask(type):
    def wrap_func(func):
        def ret(*args, **kwargs):
            def inner():
                return func(*args, **kwargs)
            return inner
        return ret

    def __new__(cls, name, bases, dct):
        for k, v in dct.items():
            if k.startswith('test'):
                dct[k] = cls.wrap_func(v)
        return super().__new__(cls, name, bases, dct)


class AIOTestCase(TestCase, metaclass=AIOMask):
    def run(self, result=None):
        self.loop = asyncio.get_event_loop()
        out = self.inner_run(result)
        f = asyncio.ensure_future(out)
        self.loop.run_until_complete(f)
        return f.result()<commit_msg>AIOTestCase: add wraps<commit_after>import asyncio
from functools import wraps
from types import CoroutineType
from unittest import TestCase
from unittest.case import _Outcome


class AIOMask(type):
    def wrap_func(func):
        @wraps(func)
        def ret(*args, **kwargs):
            def inner():
                return func(*args, **kwargs)
            return inner
        return ret

    def __new__(cls, name, bases, dct):
        for k, v in dct.items():
            if k.startswith('test'):
                dct[k] = cls.wrap_func(v)
        return super().__new__(cls, name, bases, dct)


class AIOTestCase(TestCase, metaclass=AIOMask):
    def run(self, result=None):
        self.loop = asyncio.get_event_loop()
        out = self.inner_run(result)
        f = asyncio.ensure_future(out)
        self.loop.run_until_complete(f)
        return f.result()
{'fraction_non_alphanumeric': 0.10607866507747318, 'fraction_numerical': 0.0, 'mean_word_length': 2.4405737704918034, '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': '4515772', 'n_tokens_mistral': 525, 'n_tokens_neox': 520, 'n_words': 134}