split out file discovery and test it

This commit is contained in:
Anthony Sottile 2021-11-14 19:53:35 -08:00
parent c0ddae2948
commit 66071563c2
9 changed files with 291 additions and 217 deletions

View file

@ -85,11 +85,9 @@ def test_make_checkers(_):
}
manager = checker.Manager(style_guide, files, checkplugins)
with mock.patch("flake8.utils.filenames_from") as filenames_from:
filenames_from.side_effect = [["file1"], ["file2"]]
with mock.patch("flake8.utils.fnmatch", return_value=True):
with mock.patch("flake8.processor.FileProcessor"):
manager.make_checkers()
with mock.patch("flake8.utils.fnmatch", return_value=True):
with mock.patch("flake8.processor.FileProcessor"):
manager.make_checkers(["file1", "file2"])
assert manager._all_checkers
for file_checker in manager._all_checkers: