<commit_before>""" (disabled by default) support for testing pytest and pytest plugins. """
import sys
import os
import codecs
import re
import time
import platform
from fnmatch import fnmatch
import subprocess

import py
import pytest
from py.builtin import print_
from _pytest.core import HookCaller, add_method_wrapper

from _pytest.main import Session, EXIT_OK

# used at least by pytest-xdist plugin
def pytest_funcarg___pytest(request):
    return PytestArg(request)

class PytestArg:
    def __init__(self, request):
        self.request = request

    def gethookrecorder(self, hook):
        hookrecorder = HookRecorder(hook._pm)
        self.request.addfinalizer(hookrecorder.finish_recording)
        return hookrecorder<commit_msg>accomodate Floris' comments. (The reason was i just reinstanted the old code :)<commit_after>""" (disabled by default) support for testing pytest and pytest plugins. """
import sys
import os
import codecs
import re
import time
import platform
from fnmatch import fnmatch
import subprocess

import py
import pytest
from py.builtin import print_
from _pytest.core import HookCaller, add_method_wrapper

from _pytest.main import Session, EXIT_OK

# used at least by pytest-xdist plugin
@pytest.fixture
def _pytest(request):
    """ Return a helper which offers a gethookrecorder(hook)
    method which returns a HookRecorder instance which helps
    to make assertions about called hooks.
    """
    return PytestArg(request)

class PytestArg:
    def __init__(self, request):
        self.request = request

    def gethookrecorder(self, hook):
        hookrecorder = HookRecorder(hook._pm)
        self.request.addfinalizer(hookrecorder.finish_recording)
        return hookrecorder
{'fraction_non_alphanumeric': 0.06028985507246377, 'fraction_numerical': 0.0, 'mean_word_length': 4.327160493827161, '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': '68841', 'n_tokens_mistral': 493, 'n_tokens_neox': 514, 'n_words': 177}