Merge branch 'master' into 'master'

Fix issue #39

Only raise SystemExit if there is an error.

See merge request !23
This commit is contained in:
Ian Cordasco 2015-03-11 03:00:42 +00:00
commit de281ff1f0
3 changed files with 22 additions and 2 deletions

View file

@ -19,4 +19,5 @@ Contributors (by order of appearance) :
- Marc Labbé
- Bruno Miguel Custódio
- Florent Xicluna
- Austin Morton
- Austin Morton
- Michael McNeil Forbes

View file

@ -134,4 +134,5 @@ class Flake8Command(setuptools.Command):
# Run the checkers
report = flake8_style.check_files()
exit_code = print_report(report, flake8_style)
raise SystemExit(exit_code > 0)
if exit_code > 0:
raise SystemExit(exit_code > 0)

18
flake8/tests/test_main.py Normal file
View file

@ -0,0 +1,18 @@
from __future__ import with_statement
import unittest
import setuptools
from flake8 import main
class TestMain(unittest.TestCase):
def test_issue_39_regression(self):
distribution = setuptools.Distribution()
cmd = main.Flake8Command(distribution)
cmd.options_dict = {}
cmd.run()
if __name__ == '__main__':
unittest.main()