summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-01-30 11:00:36 -0800
committerAnthony Sottile <asottile@umich.edu>2019-01-30 11:00:36 -0800
commit137b45ac2f65b72521505da21bd8fd8c30db0743 (patch)
treecfee0f8108aa5b49884fdae63627417082fa3ddb
parent941b1208193ec26b7958aa8bf3ad4221fc813e91 (diff)
downloadflake8-137b45ac2f65b72521505da21bd8fd8c30db0743.tar.gz
Fix legacy api invocation of make_notifier
-rw-r--r--src/flake8/api/legacy.py1
-rw-r--r--tests/integration/test_api_legacy.py13
-rw-r--r--tests/unit/test_legacy_api.py1
3 files changed, 13 insertions, 2 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index 2a3f10b..fd06a72 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -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)
diff --git a/tests/integration/test_api_legacy.py b/tests/integration/test_api_legacy.py
new file mode 100644
index 0000000..0ffaa22
--- /dev/null
+++ b/tests/integration/test_api_legacy.py
@@ -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
diff --git a/tests/unit/test_legacy_api.py b/tests/unit/test_legacy_api.py
index 3c577d6..1d6a3e2 100644
--- a/tests/unit/test_legacy_api.py
+++ b/tests/unit/test_legacy_api.py
@@ -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)