<commit_before>import pytest
import pytest_ansible
import json


# pytest_plugins = ['pytester', 'pytest_ansible']
pytest_plugins = 'pytester'


def test_module_ping_no_limit(ansible_module):
    '''Verify the ansible ping module across all inventory
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 5
    for host in result.values():
        assert 'failed' not in host
        assert 'invocation' in host
        assert 'module_name' in host['invocation']
        assert 'ping' == host['invocation']['module_name']

@pytest.mark.ansible(host_pattern='all')
def test_module_ping_with_limit_all(ansible_module):
    '''Verify the ansible ping module while specifying a host_pattern:all
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 5
    for host in result.values():
        assert 'failed' not in host
        assert 'invocation' in host
        assert 'module_name' in host['invocation']
        assert 'ping' == host['invocation']['module_name']

@pytest.mark.ansible(host_pattern='localhost')
def test_module_ping_limit_one(ansible_module):
    '''Verify the ansible ping module while specifying a host_pattern:localhost
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 1
    for host in result.values():
        assert 'failed' not in host<commit_msg>Add test for customizing inventory via marker<commit_after>import pytest
import pytest_ansible
import json


# pytest_plugins = ['pytester', 'pytest_ansible']
pytest_plugins = 'pytester'


def test_module_ping_no_limit(ansible_module):
    '''Verify the ansible ping module across all inventory
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 5
    for host in result.values():
        assert 'failed' not in host
        assert 'invocation' in host
        assert 'module_name' in host['invocation']
        assert 'ping' == host['invocation']['module_name']

@pytest.mark.ansible(inventory='local,')
def test_module_ping_with_local_inventory(ansible_module):
    '''Verify the ansible ping module while specifying a inventory:local,
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 1
    for host in result.values():
        assert 'failed' not in host
        assert 'invocation' in host
        assert 'module_name' in host['invocation']
        assert 'ping' == host['invocation']['module_name']

@pytest.mark.ansible(host_pattern='all')
def test_module_ping_with_limit_all(ansible_module):
    '''Verify the ansible ping module while specifying a host_pattern:all
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 5
    for host in result.values():
        assert 'failed' not in host
        assert 'invocation' in host
        assert 'module_name' in host['invocation']
        assert 'ping' == host['invocation']['module_name']

@pytest.mark.ansible(host_pattern='localhost')
def test_module_ping_limit_one(ansible_module):
    '''Verify the ansible ping module while specifying a host_pattern:localhost
    '''
    result = ansible_module.ping()
    print json.dumps(result, indent=2)
    assert len(result) == 1
    for host in result.values():
        assert 'failed' not in host
{'fraction_non_alphanumeric': 0.10957696827262045, 'fraction_numerical': 0.004112808460634548, 'mean_word_length': 3.8573466476462195, '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': '6164238', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1034, 'n_words': 281}