<commit_before>import logging
import os
import pkg_resources
import unittest

from functools import partial
from pyprint.ConsolePrinter import ConsolePrinter

from testfixtures import LogCapture

from coalib.bearlib.aspects import AspectList, get as get_aspect
from coalib.bears.BEAR_KIND import BEAR_KIND
from coalib.bears.Bear import Bear
from coalib.collecting.Collectors import (
    collect_all_bears_from_sections, collect_bears, collect_dirs, collect_files,
    collect_registered_bears_dirs, filter_section_bears_by_languages,
    get_all_bears, get_all_bears_names, collect_bears_by_aspects)
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.output.printers.ListLogPrinter import ListLogPrinter
from coalib.settings.Section import Section
from tests.TestUtilities import bear_test_module


class CollectFilesTest(unittest.TestCase):

    def setUp(self):
        current_dir = os.path.split(__file__)[0]
        self.collectors_test_dir = os.path.join(current_dir,
                                                'collectors_test_dir')
        self.log_printer = ListLogPrinter()

    def test_file_empty(self):
        self.assertRaises(TypeError, collect_files)

    def test_file_invalid(self):
        with LogCapture() as capture:
            self.assertEqual(collect_files(file_paths=['invalid_path'],
                                           log_printer=self.log_printer,
                                           ignored_file_paths=None,
                                           limit_file_paths=None,
                                           section_name='section'), [])
        capture.check(
            ('root', 'WARNING', 'No files matching \'invalid_path\' were '
                                'found. If this rule is not required, you can '
                                'remove it from section [section] in your '
                                '.coafile to deactivate this warning.')
        )

    def test_file_collection(self):<commit_msg>CollectorsTest.py: Remove unnecessary parameters<commit_after>import logging
import os
import pkg_resources
import unittest

from functools import partial
from pyprint.ConsolePrinter import ConsolePrinter

from testfixtures import LogCapture

from coalib.bearlib.aspects import AspectList, get as get_aspect
from coalib.bears.BEAR_KIND import BEAR_KIND
from coalib.bears.Bear import Bear
from coalib.collecting.Collectors import (
    collect_all_bears_from_sections, collect_bears, collect_dirs, collect_files,
    collect_registered_bears_dirs, filter_section_bears_by_languages,
    get_all_bears, get_all_bears_names, collect_bears_by_aspects)
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.output.printers.ListLogPrinter import ListLogPrinter
from coalib.settings.Section import Section
from tests.TestUtilities import bear_test_module


class CollectFilesTest(unittest.TestCase):

    def setUp(self):
        current_dir = os.path.split(__file__)[0]
        self.collectors_test_dir = os.path.join(current_dir,
                                                'collectors_test_dir')
        self.log_printer = ListLogPrinter()

    def test_file_empty(self):
        self.assertRaises(TypeError, collect_files)

    def test_file_invalid(self):
        with LogCapture() as capture:
            self.assertEqual(collect_files(file_paths=['invalid_path'],
                                           log_printer=self.log_printer,
                                           section_name='section'), [])
        capture.check(
            ('root', 'WARNING', 'No files matching \'invalid_path\' were '
                                'found. If this rule is not required, you can '
                                'remove it from section [section] in your '
                                '.coafile to deactivate this warning.')
        )

    def test_file_collection(self):
{'fraction_non_alphanumeric': 0.06514490895101308, 'fraction_numerical': 0.0005129520389843549, 'mean_word_length': 2.5230352303523036, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7229986', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1040, 'n_words': 240}