<commit_before>import datetime
import os
import sys
import traceback

import nose
import nose.plugins.base
from jinja2 import Environment, FileSystemLoader
from nose.plugins.base import Plugin

report_file_name = 'report_name.dat'
if not os.path.exists(report_file_name):
    print "creating empty report name file"
    file_write = open(report_file_name, 'w+')
    file_write.write("")


class MarketFeatures(Plugin):
    """
    provide summery report of executed tests listed per market feature
    """
    name = 'market-features'

    def __init__(self):
        super(MarketFeatures, self).__init__()
        self.results = {"results": []}
        self.exceptions = {'exceptions': []}
        self.starting_tests = {'timer': []}
        self.feature_time = None
        self.test_time = None
        with open(report_file_name, "r") as saved_file:
            generate_report_name = saved_file.read().replace('\n', '')
        self.report_file_name = generate_report_name
        if not self.report_file_name:
            self.report_file_name = "Functional Tests"

    @staticmethod
    def begin():
        print("begin")

    def help(self):
        return "provide summery report of executed tests listed per market feature"
<commit_msg>add report name file under user home<commit_after>import datetime
import os
import sys
import traceback
import nose
import nose.plugins.base
from jinja2 import Environment, FileSystemLoader
from nose.plugins.base import Plugin
from os.path import expanduser

home = expanduser("~")
report_file_name = home + '/.market_features/report_name.dat'
if not os.path.exists(report_file_name):
    os.makedirs(home + '/.market_features/')
    file_write = open(report_file_name, 'w+')
    file_write.write("")


class MarketFeatures(Plugin):
    """
    provide summery report of executed tests listed per market feature
    """
    name = 'market-features'

    def __init__(self):
        super(MarketFeatures, self).__init__()
        self.results = {"results": []}
        self.exceptions = {'exceptions': []}
        self.starting_tests = {'timer': []}
        self.feature_time = None
        self.test_time = None
        with open(report_file_name, "r") as saved_file:
            generate_report_name = saved_file.read().replace('\n', '')
        self.report_file_name = generate_report_name
        if not self.report_file_name:
            self.report_file_name = "Functional Tests"

    @staticmethod
    def begin():
        print("begin")

    def help(self):
        return "provide summery report of executed tests listed per market feature"

{'fraction_non_alphanumeric': 0.1024653312788906, 'fraction_numerical': 0.0007704160246533128, 'mean_word_length': 3.229641693811075, 'pattern_counts': {'":': 2, '<': 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': '5366652', 'n_tokens_mistral': 755, 'n_tokens_neox': 738, 'n_words': 201}