mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Merge branch 'make_notifier_gone' into 'master'
Fix legacy api invocation of make_notifier Closes #497 See merge request pycqa/flake8!293
This commit is contained in:
commit
077b640a86
3 changed files with 13 additions and 2 deletions
|
|
@ -46,7 +46,6 @@ def get_style_guide(**kwargs):
|
|||
except AttributeError:
|
||||
LOG.error('Could not update option "%s"', key)
|
||||
application.make_formatter()
|
||||
application.make_notifier()
|
||||
application.make_guide()
|
||||
application.make_file_checker_manager()
|
||||
return StyleGuide(application)
|
||||
|
|
|
|||
13
tests/integration/test_api_legacy.py
Normal file
13
tests/integration/test_api_legacy.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
"""Integration tests for the legacy api."""
|
||||
from flake8.api import legacy
|
||||
|
||||
|
||||
def test_legacy_api(tmpdir):
|
||||
"""A basic end-to-end test for the legacy api reporting errors."""
|
||||
with tmpdir.as_cwd():
|
||||
t_py = tmpdir.join('t.py')
|
||||
t_py.write('import os # unused import\n')
|
||||
|
||||
style_guide = legacy.get_style_guide()
|
||||
report = style_guide.check_files([t_py.strpath])
|
||||
assert report.total_errors == 1
|
||||
|
|
@ -22,7 +22,6 @@ def test_get_style_guide():
|
|||
mockedapp.register_plugin_options.assert_called_once_with()
|
||||
mockedapp.parse_configuration_and_cli.assert_called_once_with([])
|
||||
mockedapp.make_formatter.assert_called_once_with()
|
||||
mockedapp.make_notifier.assert_called_once_with()
|
||||
mockedapp.make_guide.assert_called_once_with()
|
||||
mockedapp.make_file_checker_manager.assert_called_once_with()
|
||||
assert isinstance(style_guide, api.StyleGuide)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue