<commit_before>import pytest
from mycli.main import format_output, special
from mycli.packages import connection
from os import getenv

# TODO: should this be somehow be divined from environment?
USER, HOST, PORT, CHARSET = 'root', 'localhost', 3306, 'utf8'
PASSWORD = getenv('PASSWORD')

def db_connection(dbname=None):
    conn = connection.connect(user=USER, host=HOST, port=PORT, database=dbname, password=PASSWORD,
                              charset=CHARSET)
    conn.autocommit = True
    return conn<commit_msg>Adds custom Cursor to unit tests.<commit_after>import pytest
from mycli.main import format_output, special
from mycli.packages import connection
from os import getenv

# TODO: should this be somehow be divined from environment?
USER, HOST, PORT, CHARSET = 'root', 'localhost', 3306, 'utf8'
PASSWORD = getenv('PASSWORD')

def db_connection(dbname=None):
    conn = connection.connect(user=USER, host=HOST, port=PORT, database=dbname, password=PASSWORD,
                              charset=CHARSET, cursorclass=connection.Cursor)
    conn.autocommit = True
    return conn
{'fraction_non_alphanumeric': 0.09149130832570906, 'fraction_numerical': 0.009149130832570906, 'mean_word_length': 4.285024154589372, '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': '177465', 'n_tokens_mistral': 323, 'n_tokens_neox': 314, 'n_words': 99}