Add black to linting
This commit is contained in:
parent
1b36bf2bb6
commit
e704175201
2 changed files with 16 additions and 0 deletions
|
@ -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"""
|
||||
|
|
|
@ -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"):
|
||||
|
|
Loading…
Reference in a new issue