<commit_before>import pandas

from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts


def test_pretty_print():
    some_stuff = '{"Dusty": "Rhodes"}'
    pretty_print(some_stuff)


def test_source_counts():
    all_counts = source_counts()
    assert isinstance(all_counts, pandas.core.frame.DataFrame)
<commit_msg>Add pytest fail check on raising pretty print exeption<commit_after>import vcr
import pandas
import pytest

from sharepa.search import ShareSearch
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts


@vcr.use_cassette('tests/vcr/simple_execute.yaml')
def test_pretty_print():
    my_search = ShareSearch()
    result = my_search.execute()
    the_dict = result.to_dict()
    try:
        pretty_print(the_dict)
    except:
        pytest.fail("Unexpected exception!!")


def test_source_counts():
    all_counts = source_counts()
    assert isinstance(all_counts, pandas.core.frame.DataFrame)

{'fraction_non_alphanumeric': 0.08668730650154799, 'fraction_numerical': 0.0, 'mean_word_length': 4.878787878787879, 'pattern_counts': {'":': 1, '<': 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': '5486147', 'n_tokens_mistral': 317, 'n_tokens_neox': 311, 'n_words': 70}