<commit_before>import os
import pytest

from click.testing import CliRunner
from mock import patch
from six.moves import input

from groceries.core import cli

del os.environ['GROCERIES_CONFIG']

mock_list = [
    dict(id=1, name='apples'),
    dict(id=2, name='bananas'),
    dict(id=3, name='citrus')]


class MockResponse(object):

    def __init__(self, status_code=200, json=None):
        self.status_code = status_code
        self.data = json if json else {}

    def json(self):
        return self.data


@pytest.fixture(scope='function')
def runner(request):
    return CliRunner()<commit_msg>check if env var exists before deleting it<commit_after>import os
import pytest

from click.testing import CliRunner
from mock import patch
from six.moves import input

from groceries.core import cli

if 'GROCERIES_CONFIG' in os.environ:
    del os.environ['GROCERIES_CONFIG']

mock_list = [
    dict(id=1, name='apples'),
    dict(id=2, name='bananas'),
    dict(id=3, name='citrus')]


class MockResponse(object):

    def __init__(self, status_code=200, json=None):
        self.status_code = status_code
        self.data = json if json else {}

    def json(self):
        return self.data


@pytest.fixture(scope='function')
def runner(request):
    return CliRunner()
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.009389671361502348, 'mean_word_length': 3.9382239382239383, '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': '6824770', 'n_tokens_mistral': 429, 'n_tokens_neox': 416, 'n_words': 112}