<commit_before>import os

import pytest

from hgtools import managers

@pytest.fixture
def hg_repo(tmpdir):
	tmpdir.chdir()
	mgr = managers.MercurialManager()
	mgr._invoke('init', '.')
	os.makedirs('bar')
	touch('bar/baz')
	mgr._invoke('addremove')
	mgr._invoke('ci', '-m', 'committed')
	with open('bar/baz', 'w') as baz:
		baz.write('content')
	mgr._invoke('ci', '-m', 'added content')
	return tmpdir


@pytest.fixture
def git_repo(tmpdir):
	tmpdir.chdir()
	mgr = managers.GitManager()
	mgr._invoke('init')
	mgr._invoke('config', 'user.email', '<EMAIL>')
	mgr._invoke('config', 'user.name', 'HGTools')
	os.makedirs('bar')
	touch('bar/baz')
	mgr._invoke('add', '.')
	mgr._invoke('commit', '-m', 'committed')
	with open('bar/baz', 'w') as baz:
		baz.write('content')
	mgr._invoke('commit', '-am', 'added content')
	return tmpdir


def touch(filename):
	with open(filename, 'a'):
		pass
<commit_msg>Skip tests if tools aren't suitable for fixtures.<commit_after>import os

import pytest

from hgtools import managers

@pytest.fixture
def hg_repo(tmpdir):
	tmpdir.chdir()
	mgr = managers.MercurialManager()
	if not mgr.is_valid():
		pytest.skip()
	mgr._invoke('init', '.')
	os.makedirs('bar')
	touch('bar/baz')
	mgr._invoke('addremove')
	mgr._invoke('ci', '-m', 'committed')
	with open('bar/baz', 'w') as baz:
		baz.write('content')
	mgr._invoke('ci', '-m', 'added content')
	return tmpdir


@pytest.fixture
def git_repo(tmpdir):
	tmpdir.chdir()
	mgr = managers.GitManager()
	if not mgr.is_valid():
		pytest.skip()
	mgr._invoke('init')
	mgr._invoke('config', 'user.email', '<EMAIL>')
	mgr._invoke('config', 'user.name', 'HGTools')
	os.makedirs('bar')
	touch('bar/baz')
	mgr._invoke('add', '.')
	mgr._invoke('commit', '-m', 'committed')
	with open('bar/baz', 'w') as baz:
		baz.write('content')
	mgr._invoke('commit', '-am', 'added content')
	return tmpdir


def touch(filename):
	with open(filename, 'a'):
		pass

{'fraction_non_alphanumeric': 0.2031413612565445, 'fraction_numerical': 0.0, 'mean_word_length': 5.144694533762058, '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': '7525292', 'n_tokens_mistral': 757, 'n_tokens_neox': 764, 'n_words': 155}