1
0
Fork 0
mirror of synced 2024-12-04 14:45:36 -05:00

Add black to linting

This commit is contained in:
Tim Byrne 2023-07-10 09:18:36 -05:00
parent 1b36bf2bb6
commit e704175201
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12
2 changed files with 16 additions and 0 deletions

View file

@ -47,6 +47,12 @@ def flake8_version():
return '6.0.0'
@pytest.fixture(scope='session')
def black_version():
"""Version of black supported"""
return '23.1.0'
@pytest.fixture(scope='session')
def yamllint_version():
"""Version of yamllint supported"""

View file

@ -55,6 +55,16 @@ def test_flake8(pytestconfig, runner, flake8_version):
assert run.success
def test_black(pytestconfig, runner, black_version):
"""Passes black"""
if not pytestconfig.getoption("--force-linters"):
run = runner(command=['black', '--version'], report=False)
if black_version not in run.out:
pytest.skip('Unsupported black version')
run = runner(command=['black', '--check', 'test'])
assert run.success
def test_yamllint(pytestconfig, runner, yamllint_version):
"""Passes yamllint"""
if not pytestconfig.getoption("--force-linters"):