<commit_before>#!/usr/bin/env python
#
# Copyright (C) 2009 <NAME>
# This software is licensed as described in the file COPYING in the root
# directory of this distribution.

from trac.env import Environment

from test.test_repository import *
from test.test_root import *
from test.test_bundle import *
from test.test_package import *
from test.test_class import *
from test.test_classextension import *
from test.test_namespace import *

import unittest

import os

env_path = os.getcwd() + '/tmp_env/'

# Create a fresh Trac env at env_path

os.system('rm -rf ' + env_path)
Environment(env_path, True)

# Run all of the test cases

unittest.main()

# Clean up the Trac env.

os.system('rm -rf ' + env_path)<commit_msg>runtests.py adjusted to function under Windows.<commit_after>#!/usr/bin/env python
#
# Copyright (C) 2009 <NAME>
# This software is licensed as described in the file COPYING in the root
# directory of this distribution.

from trac.env import Environment

from test.test_repository import *
from test.test_root import *
from test.test_bundle import *
from test.test_package import *
from test.test_class import *
from test.test_classextension import *
from test.test_namespace import *

import unittest
import os

env_path = 'tmp_env'

def remove_env():
    for root, dirs, files in os.walk(env_path, topdown=False):
        for name in files:
            os.remove(os.path.join(env_path, name))
        for name in dirs:
            os.rmdir(os.path.join(env_path, name))

# Create a fresh Trac env at env_path
remove_env()
Environment(env_path, True)

# Run all of the test cases
unittest.main()

# Clean up the Trac env.
remove_env()

{'fraction_non_alphanumeric': 0.08750754375377187, 'fraction_numerical': 0.004828002414001207, 'mean_word_length': 4.0703363914373085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7604743', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 184}