<commit_before>#!/usr/bin/env python

from cmddocs import Cmddocs
import sys
import pytest
import os
import tempfile
import git

# generate environment for each test
@pytest.fixture(scope="session", autouse=True)
def demoenv():

    # init demo dir
    d = tempfile.mkdtemp(dir="/tmp/", prefix="demodocs-")

    # create test files
    for x in range(1,5):
       x = str(x)
       f = open(d + "/testfile" + x + ".md", "ab+")
       f.write("Test " + x)
       f.close()

    # create test dirs
    for x in range(1,3):
        x = str(x)
        os.mkdir(d + "/dir" + x)

    repo = git.Repo.init(d)
    repo.git.add(".")
    repo.git.commit(m=" init")

    # create test config
    config = open(d + "/config", "ab+")

    # initialize test config
    content = """
[General]
Datadir = %s
Default_Commit_Message = small changes
Excludedir = .git/
Editor = /usr/local/bin/vim
Pager = /usr/bin/less
Prompt = cmddocs>
Promptcolor = 37
Intro_Message = cmddocs - press ? for help
Mail = <EMAIL><commit_msg>added user and mail for tests<commit_after>#!/usr/bin/env python

from cmddocs import Cmddocs
import sys
import pytest
import os
import tempfile
import git

# generate environment for each test
@pytest.fixture(scope="session", autouse=True)
def demoenv():

    # init demo dir
    d = tempfile.mkdtemp(dir="/tmp/", prefix="demodocs-")

    # create test files
    for x in range(1,5):
       x = str(x)
       f = open(d + "/testfile" + x + ".md", "ab+")
       f.write("Test " + x)
       f.close()

    # create test dirs
    for x in range(1,3):
        x = str(x)
        os.mkdir(d + "/dir" + x)

    repo = git.Repo.init(d)
    repo.git.config("user.email", "<EMAIL>")
    repo.git.config("user.name", "<NAME>")
    repo.git.add(".")
    repo.git.commit(m=" init")

    # create test config
    config = open(d + "/config", "ab+")

    # initialize test config
    content = """
[General]
Datadir = %s
Default_Commit_Message = small changes
Excludedir = .git/
Editor = /usr/local/bin/vim
Pager = /usr/bin/less
Prompt = cmddocs>
Promptcolor = 37
Intro_Message = cmddocs - press ? for help
Mail = <EMAIL>
{'fraction_non_alphanumeric': 0.15056818181818182, 'fraction_numerical': 0.005681818181818182, 'mean_word_length': 2.773214285714286, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1319659', 'n_tokens_mistral': 780, 'n_tokens_neox': 757, 'n_words': 208}