<commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function

import functools
import testtools
import fixtures
from unittest import skip


from . import tech
import os
import tempfile

import arglinker
from tracelog import TRACELOG


def xfail(test, why=""):
    """testtools' version of unittest's expectedFailure decorator

    The one from unittest does not work with testtools.TestCase!
    """
    @functools.wraps(test)
    def expect_to_fail(self):
        def errors_to_failure(f):
            # convert all exceptions including SystemExit
            # and other heavy ones to failure
            try:
                f(self)
            except BaseException as e:
                self.fail(e)
        self.expectFailure(
            why,
            errors_to_failure, arglinker.func_with_fixture_resolver(test)
        )
    return expect_to_fail


TestCase = arglinker.add_test_linker(testtools.TestCase)


class TestCase(TestCase):

    def setUp(self, *args, **kwargs):
        super(TestCase, self).setUp(*args, **kwargs)
        TRACELOG(self.__class__.__module__, self.__class__.__name__)

    def tearDown(self, *args, **kwargs):
        super(TestCase, self).tearDown(*args, **kwargs)
        TRACELOG(self.__class__.__module__, self.__class__.__name__)

    def new_temp_dir(self):
        return self.useFixture(TempDir()).path<commit_msg>remove unused test code<commit_after>from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function

import testtools
import fixtures
from unittest import skip


from . import tech
import os
import tempfile

import arglinker
from tracelog import TRACELOG


TestCase = arglinker.add_test_linker(testtools.TestCase)


class TestCase(TestCase):

    def setUp(self, *args, **kwargs):
        super(TestCase, self).setUp(*args, **kwargs)
        TRACELOG(self.__class__.__module__, self.__class__.__name__)

    def tearDown(self, *args, **kwargs):
        super(TestCase, self).tearDown(*args, **kwargs)
        TRACELOG(self.__class__.__module__, self.__class__.__name__)

    def new_temp_dir(self):
        return self.useFixture(TempDir()).path
{'fraction_non_alphanumeric': 0.08104575163398693, 'fraction_numerical': 0.0, 'mean_word_length': 3.582834331337325, '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': '5722082', 'n_tokens_mistral': 675, 'n_tokens_neox': 658, 'n_words': 177}