<commit_before>from flake8 import engine
import unittest


class TestEngine(unittest.TestCase):
    def test_get_style_guide(self):
        g = engine.get_style_guide()
        self.assertTrue(isinstance(g, engine.StyleGuide))
<commit_msg>A slow start towards rewriting the tests<commit_after>from flake8 import engine
import unittest
import mock


class TestEngine(unittest.TestCase):
    def test_get_style_guide(self):
        with mock.patch('flake8.engine._register_extensions') as reg_ext:
            reg_ext.return_value = ([], [], [])
            g = engine.get_style_guide()
            self.assertTrue(isinstance(g, engine.StyleGuide))
            reg_ext.assert_called_once_with()

    def test_get_style_guide_kwargs(self):
        m = mock.Mock()
        with mock.patch('flake8.engine.StyleGuide') as StyleGuide:
            with mock.patch('flake8.engine.get_parser') as get_parser:
                get_parser.return_value = (m, [])
                engine.get_style_guide(foo='bar')
                get_parser.assert_called_once_with()
            StyleGuide.assert_called_once_with(**{'parser': m, 'foo': 'bar'})

{'fraction_non_alphanumeric': 0.10619469026548672, 'fraction_numerical': 0.004424778761061947, 'mean_word_length': 3.142857142857143, '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': '4909321', 'n_tokens_mistral': 355, 'n_tokens_neox': 338, 'n_words': 62}