Merge branch 'legacy-api-tests' into 'master'

Add Legacy API unit tests

*Description of changes*

Add unit tests around the legacy API.

*Related to:*  n/a

See merge request !76
This commit is contained in:
Ian Cordasco 2016-07-19 16:26:42 +00:00
commit 9f2eac7df1
2 changed files with 148 additions and 2 deletions

View file

@ -115,8 +115,9 @@ class StyleGuide(object):
def init_report(self, reporter=None):
"""Set up a formatter for this run of Flake8."""
if (reporter is not None and
not issubclass(reporter, formatter.BaseFormatter)):
if reporter is None:
return
if not issubclass(reporter, formatter.BaseFormatter):
raise ValueError("Report should be subclass of "
"flake8.formatter.BaseFormatter.")
self._application.make_formatter(reporter)