test/pylint: add autopep8 test
Add a test to ensure our source code is PEP-8 compliant.
This commit is contained in:
parent
f05078f66e
commit
cae23de605
1 changed files with 7 additions and 0 deletions
|
|
@ -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)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue