def test_flake8(self): """ Test codebase for compliance with the flake8 tool. """ report, message = check_flake8() file_count = report.counters["files"] error_count = report.get_count() self.assertGreater(file_count, 10) self.assertEqual(error_count, 0, "\n" + message.decode())
def test_flake8(self): """ Test codebase for compliance with the flake8 tool. """ report, message = check_flake8() file_count = report.counters["files"] error_count = report.get_count() self.assertTrue(file_count > 10) self.assertEqual(error_count, 0, message)
ROOT = os.path.dirname(__file__) PEP8_IMAGE = os.path.join(ROOT, 'source', 'pep8', 'pep8.png') PEP8_FAIL_IMAGE = os.path.join(ROOT, 'source', '_static', 'pep8-failing.png') PEP8_PASS_IMAGE = os.path.join(ROOT, 'source', '_static', 'pep8-passing.png') path = obspy.__path__[0] try: os.makedirs(os.path.join('source', 'pep8')) except: pass report, message = check_flake8() statistics = report.get_statistics() error_count = report.get_count() # write index.rst head = (""" .. _pep8-index: ==== PEP8 ==== .. image:: pep8.png Like most Python projects, we try to adhere to :pep:`8` (Style Guide for Python Code) and :pep:`257` (Docstring Conventions) with the modifications documented
import obspy from obspy.core.util.testing import check_flake8 ROOT = os.path.dirname(__file__) PEP8_IMAGE = os.path.join(ROOT, 'source', 'pep8', 'pep8.svg') PEP8_FAIL_IMAGE = os.path.join(ROOT, 'source', '_images', 'pep8-failing.svg') PEP8_PASS_IMAGE = os.path.join(ROOT, 'source', '_images', 'pep8-passing.svg') path = obspy.__path__[0] try: os.makedirs(os.path.join('source', 'pep8')) except: pass report, message = check_flake8() statistics = report.get_statistics() error_count = report.get_count() # write index.rst head = (""" .. _pep8-index: ==== PEP8 ==== .. image:: pep8.svg Like most Python projects, we try to adhere to :pep:`8` (Style Guide for Python Code) and :pep:`257` (Docstring Conventions) with the modifications documented