mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
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:
commit
de281ff1f0
3 changed files with 22 additions and 2 deletions
|
|
@ -19,4 +19,5 @@ Contributors (by order of appearance) :
|
||||||
- Marc Labbé
|
- Marc Labbé
|
||||||
- Bruno Miguel Custódio
|
- Bruno Miguel Custódio
|
||||||
- Florent Xicluna
|
- Florent Xicluna
|
||||||
- Austin Morton
|
- Austin Morton
|
||||||
|
- Michael McNeil Forbes
|
||||||
|
|
|
||||||
|
|
@ -134,4 +134,5 @@ class Flake8Command(setuptools.Command):
|
||||||
# Run the checkers
|
# Run the checkers
|
||||||
report = flake8_style.check_files()
|
report = flake8_style.check_files()
|
||||||
exit_code = print_report(report, flake8_style)
|
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
18
flake8/tests/test_main.py
Normal 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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue