暂无描述

test_lint.py 1023B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python
  2. # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
  3. ### BEGIN LICENSE
  4. # This file is in the public domain
  5. ### END LICENSE
  6. import unittest
  7. import subprocess
  8. class TestPylint(unittest.TestCase):
  9. def test_project_errors_only(self):
  10. '''run pylint in error only mode
  11. your code may well work even with pylint errors
  12. but have some unusual code'''
  13. return_code = subprocess.call(["pylint", '-E', 'organiccode'])
  14. # not needed because nosetests displays pylint console output
  15. #self.assertEqual(return_code, 0)
  16. # un-comment the following for loads of diagnostics
  17. #~ def test_project_full_report(self):
  18. #~ '''Only for the brave
  19. #~
  20. #~ you will have to make judgement calls about your code standards
  21. #~ that differ from the norm'''
  22. #~ return_code = subprocess.call(["pylint", 'organiccode'])
  23. if __name__ == '__main__':
  24. 'you will get better results with nosetests'
  25. unittest.main()