<commit_before>import pytest
import subprocess


@pytest.fixture(scope="session")
def example_project():
    output = subprocess.check_output(
        ['pip', 'install', '-e', 'example_project'],
        stderr=subprocess.STDOUT)
    assert b'Successfully installed textX-subcommand-test' in output


def test_single_subcommand(example_project):
    """
    Test that a single top-level command from the example project is
    registered.
    """
    output = subprocess.check_output('textx')
    assert b'testcommand' in output


def test_subcommand_group(example_project):
    """
    Test that a command group is registered.
    """
    output = subprocess.check_output(['textx', 'testgroup'])
    assert b'groupcommand1' in output
    assert b'groupcommand2' in output<commit_msg>refs #161 Fixing path used for test example project.<commit_after>import os
import pytest
import subprocess


@pytest.fixture(scope="session")
def example_project():
    this_folder = os.path.dirname(__file__)
    output = subprocess.check_output(
        ['pip', 'install', '-e', os.path.join(this_folder, 'example_project')],
        stderr=subprocess.STDOUT)
    assert b'Successfully installed textX-subcommand-test' in output


def test_single_subcommand(example_project):
    """
    Test that a single top-level command from the example project is
    registered.
    """
    output = subprocess.check_output('textx')
    assert b'testcommand' in output


def test_subcommand_group(example_project):
    """
    Test that a command group is registered.
    """
    output = subprocess.check_output(['textx', 'testgroup'])
    assert b'groupcommand1' in output
    assert b'groupcommand2' in output
{'fraction_non_alphanumeric': 0.10426540284360189, 'fraction_numerical': 0.004146919431279621, 'mean_word_length': 4.0568862275449105, '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': '5993792', 'n_tokens_mistral': 498, 'n_tokens_neox': 486, 'n_words': 132}