test/pylint: add autopep8 test

Add a test to ensure our source code is PEP-8 compliant.
This commit is contained in:
Christian Kellner 2022-08-04 16:53:15 +02:00
parent f05078f66e
commit cae23de605

View file

@ -53,3 +53,10 @@ def test_pylint(source_files):
#
subprocess.run(["pylint"] + source_files, check=True)
@pytest.mark.skipif(not test.TestBase.have_autopep8(), reason="autopep8 not available")
def test_autopep8(source_files):
r = subprocess.run(["autopep8-3", "--diff", "--exit-code"] + source_files, check=False)
if r.returncode != 0:
pytest.fail("autopep8 has detected changes (see diff)")