<commit_before>import socket
import unittest
from functools import wraps

import asyncio
from aiohttp import log
from chilero import web


def asynctest(f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        @asyncio.coroutine
        def go():
            yield from f(*args, **kwargs)

        loop = asyncio.get_event_loop()
        loop.run_until_complete(go())
    return wrapper


class WebTestCase(unittest.TestCase):
    application = web.Application
    routes = []

    def setUp(self):
        self.loop = asyncio.new_event_loop()
        asyncio.set_event_loop(self.loop)

        @asyncio.coroutine
        def go():
            self.app = self.application(self.routes)
            yield from self.create_server()

        self.loop.run_until_complete(go())

    def tearDown(self):
        self.app.finish()
        self.loop.close()

    @asyncio.coroutine<commit_msg>Specify the current loop in WebTestCase application<commit_after>import socket
import unittest
from functools import wraps

import asyncio
from aiohttp import log
from chilero import web


def asynctest(f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        @asyncio.coroutine
        def go():
            yield from f(*args, **kwargs)

        loop = asyncio.get_event_loop()
        loop.run_until_complete(go())
    return wrapper


class WebTestCase(unittest.TestCase):
    application = web.Application
    routes = []

    def setUp(self):
        self.loop = asyncio.new_event_loop()
        asyncio.set_event_loop(self.loop)

        @asyncio.coroutine
        def go():
            self.app = self.application(self.routes, loop=self.loop)
            yield from self.create_server()

        self.loop.run_until_complete(go())

    def tearDown(self):
        self.app.finish()
        self.loop.close()

    @asyncio.coroutine
{'fraction_non_alphanumeric': 0.09989082969432314, 'fraction_numerical': 0.0, 'mean_word_length': 2.5454545454545454, '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': '2533848', 'n_tokens_mistral': 565, 'n_tokens_neox': 556, 'n_words': 126}