<commit_before>from inspect import getdoc

import pytest


class CodeCollector(object):
    def __init__(self, name="code"):

        self.name = name
        self.collected = []

    def __call__(self, f):

        self.collected.append(f)
        return f

    def xfail(self, f):

        self(pytest.param(f, marks=pytest.mark.xfail))
        return f

    def __iter__(self):

        return iter(self.collected)

    def parametrize(self, test_func):

        return pytest.mark.parametrize(self.name, self, ids=getdoc)(test_func)<commit_msg>Show collected function name instead of docstring in the test repr.<commit_after>import pytest


class CodeCollector(object):
    def __init__(self, name="code"):

        self.name = name
        self.collected = []

    def __call__(self, f):

        self.collected.append(f)
        return f

    def xfail(self, f):

        self(pytest.param(f, marks=pytest.mark.xfail))
        return f

    def __iter__(self):

        return iter(self.collected)

    def parametrize(self, test_func):

        return pytest.mark.parametrize(self.name, self)(test_func)
{'fraction_non_alphanumeric': 0.10720720720720721, 'fraction_numerical': 0.0, 'mean_word_length': 2.703333333333333, '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': '5597099', 'n_tokens_mistral': 369, 'n_tokens_neox': 354, 'n_words': 80}