britney2-ubuntu/tests/test_pycodestyle.py
Niels Thykier 822a8c712c
Migrate to pycodestyle and setup a basic config file
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 12:03:33 +00:00

16 lines
517 B
Python

import os
import unittest
import pycodestyle
class TestCodeFormat(unittest.TestCase):
def test_conformance(self):
"""Test that we conform to PEP-8."""
project_dir = os.path.dirname(os.path.dirname(__file__))
codestyle_cfg = os.path.join(project_dir, 'setup.cfg')
style = pycodestyle.StyleGuide(config_file=codestyle_cfg)
result = style.check_files('.')
self.assertEqual(result.total_errors, 0,
"Found code style errors (and warnings).")