Geen omschrijving

test_lint.py 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
  3. ### BEGIN LICENSE
  4. # Copyright (C) 2013 Bryan M. Allred <bryan.allred@gmail.com>
  5. # This program is free software: you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License version 3, as published
  7. # by the Free Software Foundation.
  8. #
  9. # This program is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranties of
  11. # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
  12. # PURPOSE. See the GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License along
  15. # with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ### END LICENSE
  17. import unittest
  18. import subprocess
  19. class TestPylint(unittest.TestCase):
  20. def test_project_errors_only(self):
  21. '''run pylint in error only mode
  22. your code may well work even with pylint errors
  23. but have some unusual code'''
  24. return_code = subprocess.call(["pylint", '-E', 'organiccode'])
  25. # not needed because nosetests displays pylint console output
  26. #self.assertEqual(return_code, 0)
  27. # un-comment the following for loads of diagnostics
  28. #~ def test_project_full_report(self):
  29. #~ '''Only for the brave
  30. #~
  31. #~ you will have to make judgement calls about your code standards
  32. #~ that differ from the norm'''
  33. #~ return_code = subprocess.call(["pylint", 'organiccode'])
  34. if __name__ == '__main__':
  35. 'you will get better results with nosetests'
  36. unittest.main()